Quote:
Originally Posted by ffcmike
Your assigning of variables is correct, it is the comparing of variables within the if conditions which is incorrect, using an assignment causes the if conditions to always be true.
It should be for example:
PHP Code:
if(playertouchsme){
if(this.value == 2){
this.value = 3;
}
}
Doing something like:
PHP Code:
if(this.value = 2){
//stuff
}
is essentially the same as:
PHP Code:
if(true){
//stuff
}
It's probably worth mentioning that the opposite can also be applied for doing 'not equal to', for example:
PHP Code:
if(playertouchsme){
if(this.value != 2){
this.value = 2;
}
}
In that case, you should write and read the 'bomb' variable without using 'this.', so it is a global flag, rather than one tied to the weapon.
|
I don't get why I need to compare variables, also would client.variable work for global flags? Though it probably is the comparing variables because I can place the bomb but it blows up on it's own.