SA-MP Forums Archive
OnPlayerDisconnect - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerDisconnect (/showthread.php?tid=617021)



OnPlayerDisconnect - MerryDeer - 14.09.2016

Hi,

When player disconnect and this callback get called, other player can't connect until all content in onplayerdisconnect will be completed?


Re: OnPlayerDisconnect - JaKe Elite - 14.09.2016

Nope, Players can connect while the OnPlayerDisconnect is being called.


Re: OnPlayerDisconnect - Vince - 14.09.2016

Pretty sure that they can't occupy the same playerslot as the disconnecting player, though. It also wouldn't make sense. In case of a crash or a timeout OnPlayerDisconnect sometimes isn't even called until 30 seconds after the player's game has closed.


Re: OnPlayerDisconnect - MerryDeer - 14.09.2016

So how to make other player in that slot can't connect until onplayerdisconnect will be called? because if you say 30 seconds need wait, then all saving can bugg. I use player variables, then new connect player can change them and no saving


Re: OnPlayerDisconnect - Rufio - 14.09.2016

The information here can be misleading. A player can connect once the saving process is finished, saving process ends in a few ms's. If you are using MySQL, you can wipe the playerid's cache data to prevent the script to overwritw saves but that's about it. I doubt anyone has faced an issue where a player's data got saved into another player's before.


Re: OnPlayerDisconnect - MerryDeer - 14.09.2016

I talk not about saving. But also about simple variable checks. It's possible just in OnPlayerDisconnect check how much time takes call?


Re: OnPlayerDisconnect - MerryDeer - 14.09.2016

Or still i don't understand server will give new player new slot, until that slot in which player disconnect was onplayerdisconnect not called?


Re: OnPlayerDisconnect - Logic_ - 14.09.2016

reset the variables on player connect.


Re: OnPlayerDisconnect - Stinged - 14.09.2016

The server will give a free playerid. They won't overlap, if that's what you're talking about.


Re: OnPlayerDisconnect - MerryDeer - 14.09.2016

Yes i reset player variables onplayerconnect, but what if 0 playerid connect and after 5 seconds call onplayerdisconnect with playerid 0 with old player disconnecting, so it's get bugged. Or this never happin? just it's possible when player connecting onplayerconnect get call, and during ddos, lagg or other shit, onplayerdisconnect was delay to call, and it calls?