Hi all i was just wondering how i would go about making a code like so i can have it like .......
if(usr.level ==
and then after that make it so it is level 1 throw 10
thank you
ID:174032
![]() Oct 10 2003, 8:09 am
|
|
On this topic since someone said somethin about it. Has anyone had any problems with using && and || with vars without setting a value in the condition? Like for boolean values for instance? Ive had major problems with things like if(usr.bVar1 || usr.bVar2) each being bools so will only ever equal 0 or 1 off or on. But the if statement will not work. That ever happened to anyone else? I eventually had to do if(usr.bVar1 == 1 || usr.bVar2 == 1) and I ran into probs with it too so I broke down into two seperate ifs one for each before I could get it to work. /shrugs
|
On this topic since someone said somethin about it. Has anyone had any problems with using && and || with vars without setting a value in the condition? Like for boolean values for instance? Ive had major problems with things like if(usr.bVar1 || usr.bVar2) each being bools so will only ever equal 0 or 1 off or on. But the if statement will not work. That ever happened to anyone else? I eventually had to do if(usr.bVar1 == 1 || usr.bVar2 == 1) and I ran into probs with it too so I broke down into two seperate ifs one for each before I could get it to work. /shrugs False is 0, null, and "" True is everything else. So true isn't only 1 which may be your problem but I can't tell without seeing the source code behind it. |
well what Im sayin when I say it only can be 0 or 1 is that is ALL its possible for it to be set in code. The default value is 0 and the only other value it would ever have is 1.
|
well what Im sayin when I say it only can be 0 or 1 is that is ALL its possible for it to be set in code. The default value is 0 and the only other value it would ever have is 1. Just post up the defective code and I'm sure someone will have an answer as to why things are behaving the way they are for you. |
if(usr.level >= 1 && usr.level <= 10)