02.02.2014, 18:17
Quote:
Same question was asked a while back. For default callbacks, it tells the server whether it should process the same callback in other (filter)scripts.
|
And whenever a default callback is called it ALWAYS calls the one within the gamemode script? I've noticed that returning the value 0 in the 'OnPlayerText' callback will stop the chat all together to allow a custom chat format. I guess this is the process?:
Код:
> Player talks > 'OnPlayerText' is called in the gamemode script > Code gets executed > return 1: > Processes the message in an internal script > Continues to other filterscripts > return 0: > Callback stops completely, not called anywhere else
Quote:
In custom callbacks is not necessary to return values and it's not actually necessary to return a value to some of the callbacks (by samp) either.
You may see in SA-MP Wiki in some callbacks to say "This callback does not handle returns." and some other say what happens if we return a specific value. Let's take an example of OnPlayerCommandText callback. SA-MP Wiki says: Returning 0 in some callbacks stops those callbacks from being called in other modes such as filterscripts etc. Another example is OnPlayerText callback and returning 0 will disable the default chat. |