SA-MP Forums Archive
variables checking row - 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: variables checking row (/showthread.php?tid=624571)



variables checking row - MerryDeer - 18.12.2016

Hi,

How checking if variables?

if i do

if( GetPlayerScore(playerid) < 500 && GetPlayerMoney( playerid ) > 5000 )
{

}

first will by checked getplayerscore, or getplayermoney or it's random?


Re: variables checking row - CutX - 18.12.2016

left to right, GetPlayerScore first then GetPlayerMoney.

since you are using &&, both functions will be called,
but for example, if it's something like this with OR
Код:
if(this() || that())
if this() returns true, the whole if statement results in true and further checking
of, in this case, that() won't happen