Question about "return"
#8

Unless the return value ("false") of PublicGMX gets assigned or used somewhere (see below for example), it doesn't matter. Some prefer to return 0 to indicate something has failed.

pawn Код:
if(PublicGMX() == true)
{
    // success
}
else
{
    // fail
}
Return values in the default SA-MP callbacks usually control whether or not the same callback should also be called in filterscripts that are being loaded. In OnPlayerCommandText, returning 1 means that the command was found and that no further processing should occur.

In pretty much all other callbacks, the opposite is true. Returning 1 means that additional code in filterscripts will be executed. Returning 0 will prevent just that.
Reply


Messages In This Thread
Question about "return" - by Riwerry - 05.01.2014, 19:46
Re: Question about "return" - by Voxel - 05.01.2014, 19:49
Re: Question about "return" - by RedFusion - 05.01.2014, 19:49
Re: Question about "return" - by Riwerry - 05.01.2014, 19:51
Re: Question about "return" - by RedFusion - 05.01.2014, 20:18
Re: Question about "return" - by Riwerry - 05.01.2014, 20:22
Re: Question about "return" - by K9IsGodly - 05.01.2014, 20:25
Re: Question about "return" - by Vince - 05.01.2014, 20:44

Forum Jump:


Users browsing this thread: 1 Guest(s)