Posts: 91
Threads: 6
Joined: Apr 2013
Posts: 973
Threads: 10
Joined: Sep 2012
Reputation:
0
Depends, some return 1, others 0, the exact same as a gamemode.
Make it simple and use it as if you're scripting a Game Mode, it doesn't differ.
Posts: 151
Threads: 56
Joined: Jul 2010
Reputation:
0
Thanks, I was concerned about it. I think someone once said here that it should return 0, he said it about OnDialogResponse
Posts: 1,765
Threads: 1
Joined: Aug 2011
Reputation:
0
Oke I dont make filter scripts but the way I understand returns is that...
Return 1; All fine tge public was a success now stop running it.
Return Value; means pass this value to the location which called this function then stop running it
Return 0; means command failed.. Or return nothing to the caller.
If your using it in a filter script I understood that you removed the returns, and the compiler complains but ignore that, and it allows the information to pass to tge other scripts. Bars in mind I've only made about 13 filter scripts most of which years ago.
Functions per made by samp such as on dialog response should be the default return, ondialog is 0
Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
Different callbacks handle returns differently. Some callbacks don't handle returns, such as OnPlayerSpawn - returning 0 in a FS won't stop it being called in a FS. For OnPlayerCommandText, return 1 signifies that the command has been processed in the FS and it won't be called in the GM.
One notable thing is that to use OnRconCommand in your gamemode, it must be used in a filterscript.