pawno is very simular with php and i have a question
#1

what does return 1 do? also return 0 couldnt find anything about it in documentation
Reply
#2

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.


Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)