SA-MP Forums Archive
if statements - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: if statements (/showthread.php?tid=179918)



if statements - sacman - 29.09.2010

Код:
if(Hour < 10 && Minute < 10)return SendClientMessage(playerid, COLOR_WHITE, string3);
I was wondering how would I make this work properly, having two things checked if they are less than 10 than send a client message to the user.


Re: if statements - LarzI - 29.09.2010

This should work.
You could also do
pawn Код:
if(( Hour && Minute ) < 10 )
    return SendClientMessage( playerid, COLOR_WHITE, string3 );



Re: if statements - Simon - 29.09.2010

Your original code should work fine if BOTH are less than 10.

@ LarzI:

That shouldn't work. Your Hour && Minute expression will evaluate to true/false before it's compared to 10, even then I wonder if the compiler would chuck you a warning/error.