ID:167191
 
if(usr.lvl >= 0)<dm/>

say i use 'if' but how do i make it so that insead of just if lvl is equal to certain numbers it proceeds. how do i do this with on line of code for that 'if' statment.

<dm>if(usr.lvl == 14,24,34,44)<dm/>

like that but without the annoying "if, extra args"
Edge657123 wrote:
if(usr.lvl >= 0)<dm/>
>
> say i use 'if' but how do i make it so that insead of just if lvl is equal to certain numbers it proceeds. how do i do this with on line of code for that 'if' statment.
>
> <dm>if(usr.lvl == 14,24,34,44)<dm/>
>
> like that but without the annoying "if, extra args"

You can use <a href="http://www.byond.com/docs/ref/info.html#/operator/||">the || operator</a>
In response to Airjoe
i dont get it how do i pit it like this

if(usr.lvl == 1 || 2)
In response to Edge657123
Edge657123 wrote:
i dont get it how do i pit it like this

if(usr.lvl == 1 || 2)

Close!

if(usr.lvl == 1 || usr.level == 2)
In response to Airjoe
you could also do
if(level in list(1,2,3,4))
^_^
In response to Zmadpeter
Well, if you're doing 14, 24, 34, 44, etc. you can do this
if(!(lvl-4)%10))


But that of course needs to be tweaked in each different situation, and can only be used with patterns. So what the Zmadpeter said was good.
In response to Zmadpeter
thanks guys another day another lession lernt