pawno is very simular with php and i have a 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: pawno is very simular with php and i have a question (
/showthread.php?tid=104745)
pawno is very simular with php and i have a question -
Drezek - 26.10.2009
what does return 1 do? also return 0 couldnt find anything about it in documentation
Re: pawno is very simular with php and i have a question -
yom - 26.10.2009
I assume you are asking what does return 1 or return 0 do
inside some SA:MP callbacks (such as OnPlayerText).
It's not easy to explain why return 1 and return 0 are used, but i will try (personally i prefer to use 'return true' and 'return false' - same thing but more explicite):
To be short and simple, inside the SA:MP server there is a conditional statement such as
Код:
if (OnPlayerText(playerid, text) == true)
SendTheTextInTheChat();
In a PAWN script, if you do:
pawn Код:
public OnPlayerText(playerid, text[])
return false; //or return 0, same thing
then that conditional statement inside the SA:MP server will not be true, so the function SendTheTextInTheChat() will not be called, and as a result, the text message will not be send in the chat.
Hope this help you to understand. And no, PAWN isn't very similar to php, in fact most programming languages have similarities but big differences..there are big differences with php and PAWN.