if - return - 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: if - return (
/showthread.php?tid=371267)
if - return -
NewbieScripter - 23.08.2012
example
pawn Код:
if(playerinfo[playerid][plevel] > 1) return SendClientMessage(playerid, -1, "string");
if(playerinfo[playerid][plevel] > 1) SendClientMessage(playerid, -1, "string");
what change ? anything ?
Re: if - return -
Vince - 23.08.2012
Return returns. What's so hard to understand about that? If you have a block of code underneath the statement it will execute if there isn't a return. It won't execute if there is.
Re: if - return -
ReneG - 23.08.2012
return stops a block of code from running.
Re: if - return -
Guitar - 23.08.2012
The link below might be off-topic but, it will help you understanding "return 0"
https://sampforum.blast.hk/showthread.php?tid=370127