[QUESTION] OnPlayer(Dis)Connect in FS (return 0 or 1?) -
Kwarde - 14.05.2013
NOTE: Question solved; please don't reply something like "return 1" or "return 0" unless if you have extra usefull information
Hello there!
I have a question for you!
There are callbacks like OnDialogResponse() where you must use 'return 0' if nothing happened so that other scripts will use the function too.
Now I am just wondering, do I need to use 'return 1;' or 'return 0;' in OnPlayerConnect() and OnPlayerDisconnect()? I first thought, let's just ignore it and don't use any returns, but sscanf2 forces me to do so

.
Because if I do this wrong, the script I made (check my signature) might bug the gamemode or other filterscripts!
Normally I'd test it out, but I made a script for someone using return 0 (just like in this BugReport filterscript) but that seemed to bug his server.. but I use this filterscript in my local server too (for testing off course) without any problems!
Kind regards,
Kwarde
Re: [QUESTION] OnPlayer(Dis)Connect in FS (return 0 or 1?) -
DeMoX - 14.05.2013
I'm not really sure but i'm using return 1; on my server, (including sscanf, streamer...etc) and every thing is working fine.
Re: [QUESTION] OnPlayer(Dis)Connect in FS (return 0 or 1?) -
MP2 - 14.05.2013
returns only affect a couple of callbacks (including OnPlayerCommandText, OnPlayerText, OnPlayerClick(Player)TextDraw, OnPlayerEdit/SelectObject etc.). It won't affect OnPlayer(Dis)Connect. In my experience I've found that OnPlayerConnect only works in the first loaded filterscript. Can be fixed with CallRemoteFunction.
Re: [QUESTION] OnPlayer(Dis)Connect in FS (return 0 or 1?) -
Matt - 14.05.2013
return 1 i guess
Re: [QUESTION] OnPlayer(Dis)Connect in FS (return 0 or 1?) -
radiobizza - 15.05.2013
return 1; I am sure
Re: [QUESTION] OnPlayer(Dis)Connect in FS (return 0 or 1?) -
Kwarde - 15.05.2013
Quote:
Originally Posted by MP2
returns only affect a couple of callbacks (including OnPlayerCommandText, OnPlayerText, OnPlayerClick(Player)TextDraw, OnPlayerEdit/SelectObject etc.). It won't affect OnPlayer(Dis)Connect. In my experience I've found that OnPlayerConnect only works in the first loaded filterscript. Can be fixed with CallRemoteFunction.
|
Allrighty then, thanks for the reply! And thanks for that tip. (Everyone thanks by the way ;3).
Re: [QUESTION] OnPlayer(Dis)Connect in FS (return 0 or 1?) -
Kwarde - 15.05.2013
Quote:
Originally Posted by ******
|
It surely is :')
Off course I took a look at it already, but since I once had problems with returning 0, but also with 1 I was wondering if it perhaps secretly did need to have a specific return

I preferred to not return anything, but because of your sscanf include, it forced me to return something and I got kinda confused at that point. And I prefer to ask something if I'm not sure about it over just ignoring it, if you don't mind.
Perhaps I can immediately also ask to you; why does OnPlayerConnect need to return a value with the sscanf2 include?
Quote:
So\Many\Directories\Over\Here\tmp.pwn(107) : warning 209: function "SSCANF_OnPlayerConnect" should return a value
|
Kind regards,
Kevin
Re: [QUESTION] OnPlayer(Dis)Connect in FS (return 0 or 1?) -
Kwarde - 15.05.2013
I get it. Thank you very much!
AW: Re: [QUESTION] OnPlayer(Dis)Connect in FS (return 0 or 1?) -
HurtLocker - 15.05.2013
Quote:
Originally Posted by MP2
returns only affect a couple of callbacks (including OnPlayerCommandText, OnPlayerText, OnPlayerClick(Player)TextDraw, OnPlayerEdit/SelectObject etc.). It won't affect OnPlayer(Dis)Connect. In my experience I've found that OnPlayerConnect only works in the first loaded filterscript. Can be fixed with CallRemoteFunction.
|
Man why didn't you mention this on my thread? I love you!!!! (Dis)Connect in register/login system works fine now!
https://sampforum.blast.hk/showthread.php?tid=432617