What is the purpose of 'return' in callbacks?
#3

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:
Quote:

Returning 0 informs the server that the command hasn't been processed by this script. OnPlayerCommandText will be called in other scripts until one returns 1.

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.
Reply


Messages In This Thread
What is the purpose of 'return' in callbacks? - by Bicentric - 02.02.2014, 18:02
Re: What is the purpose of 'return' in callbacks? - by Vince - 02.02.2014, 18:09
Re: What is the purpose of 'return' in callbacks? - by Konstantinos - 02.02.2014, 18:12
Re: What is the purpose of 'return' in callbacks? - by Bicentric - 02.02.2014, 18:17
Re: What is the purpose of 'return' in callbacks? - by PowerPC603 - 02.02.2014, 18:28

Forum Jump:


Users browsing this thread: 2 Guest(s)