Blockland Forums > Modification Help

Warning script. Line 37 Syntax error.

Pages: << < (2/3) > >>

Wordy:


--- Quote from: Otis Da HousKat on January 29, 2012, 10:01:02 AM ---You shouldn't use the assignment operator for boolean expressions.

--- End quote ---
how do you mean?

Headcrab Zombie:


--- Quote from: Wordy on January 29, 2012, 10:20:13 AM ---how do you mean?

--- End quote ---
You're doing if(%name.isWarned=1)
This is setting isWarned to 1, it's not checking if it's already equal to 1. You want to change the = to ==
So if(%name.isWarned==1), or since you're checking a boolean value you can drop the == part and just use if(%name.isWarned), just like how you're doing admin checks

CityRPG:

Just a heads up, I find it cleaner to make boolean values actually boolean. If you set something to true or false instead of 1, it lets you know when you're working with very big projects that that variable is binary.

mp7964:

You capitalized the f in function, for one. Don't do that.

Nexus:

do not confuse %name with a client; they are completely different

%name is what you type in
a client is an object id number
what you will need to do is %targetclient = findclientbyname(%name);
It is also reccommended that you do a check to make sure that the %targetclient exists after finding it.

Pages: << < (2/3) > >>

Go to full version