Condition question
#1

Hey everyone , imagine we have a code like this :
pawn Код:
if(adminlevel>1 or what ever) //cond1
{
//things
}
if(blabla)//cond2
{
}
the server will check if condition 1 is true then stop and will not contunue or will contunue and check if the player has the two condition ?

thank you
Reply
#2

Yes. Use logical operators:
pawn Код:
if(adminlevel>1 or what ever [COLOR="Red"]||[/COLOR] [COLOR="Black"]variable>1[/COLOR]) // [COLOR="Red"]||[/COLOR] means "or"
{
//things
}
Reply
#3

thank you!
Reply
#4

Just for future reference:
  • && means AND
    pawn Код:
    //example
    if ( condition_1 && condition_2 ) // Will be executed ONLY if both conditions are true.
  • != means not equal to
    pawn Код:
    //example
    if ( a_var != 0 ) // Will be executed ONLY if a_var is not 0.
  • || means or. Example given above!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)