Condition question - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Condition question (
/showthread.php?tid=421132)
Condition question -
Saw® - 08.03.2013
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
Re: Condition question -
DiGiTaL_AnGeL - 08.03.2013
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
}
Re: Condition question -
Saw® - 08.03.2013
thank you!
Re: Condition question -
RajatPawar - 08.03.2013
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!