SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 14/09/2016, 10:16 AM   #1
MerryDeer
Banned
 
Join Date: Jun 2016
Posts: 723
Reputation: 8
Default OnPlayerDisconnect

Hi,

When player disconnect and this callback get called, other player can't connect until all content in onplayerdisconnect will be completed?
MerryDeer is offline   Reply With Quote
Old 14/09/2016, 10:27 AM   #2
JaKe Elite
High-roller
 
JaKe Elite's Avatar
 
Join Date: Apr 2012
Location: Philippines
Posts: 3,691
Reputation: 486
Default Re: OnPlayerDisconnect

Nope, Players can connect while the OnPlayerDisconnect is being called.
__________________
Haven County Roleplay (Click here to join the server)
Discord: Click here to join our Discord
Website: Click here to register
____________________________
Discord: Corporal★Shepard#3135
JaKe Elite is offline   Reply With Quote
Old 14/09/2016, 11:01 AM   #3
Vince
Spam Machine
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 10,079
Reputation: 2655
Default Re: OnPlayerDisconnect

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.
__________________
Vince is offline   Reply With Quote
Old 14/09/2016, 11:13 AM   #4
MerryDeer
Banned
 
Join Date: Jun 2016
Posts: 723
Reputation: 8
Default Re: OnPlayerDisconnect

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
MerryDeer is offline   Reply With Quote
Old 14/09/2016, 11:20 AM   #5
Rufio
Huge Clucker
 
Join Date: May 2011
Location: Turkey
Posts: 415
Reputation: 40
Default Re: OnPlayerDisconnect

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.
Rufio is offline   Reply With Quote
Old 14/09/2016, 12:10 PM   #6
MerryDeer
Banned
 
Join Date: Jun 2016
Posts: 723
Reputation: 8
Default Re: OnPlayerDisconnect

I talk not about saving. But also about simple variable checks. It's possible just in OnPlayerDisconnect check how much time takes call?
MerryDeer is offline   Reply With Quote
Old 14/09/2016, 05:53 PM   #7
MerryDeer
Banned
 
Join Date: Jun 2016
Posts: 723
Reputation: 8
Default Re: OnPlayerDisconnect

Or still i don't understand server will give new player new slot, until that slot in which player disconnect was onplayerdisconnect not called?
MerryDeer is offline   Reply With Quote
Old 14/09/2016, 05:59 PM   #8
Logic_
Banned
 
Join Date: Jun 2015
Posts: 1,513
Reputation: 305
Default Re: OnPlayerDisconnect

reset the variables on player connect.
Logic_ is offline   Reply With Quote
Old 14/09/2016, 06:02 PM   #9
Stinged
High-roller
 
Join Date: Feb 2013
Posts: 1,574
Reputation: 187
Default Re: OnPlayerDisconnect

The server will give a free playerid. They won't overlap, if that's what you're talking about.
Stinged is offline   Reply With Quote
Old 14/09/2016, 06:12 PM   #10
MerryDeer
Banned
 
Join Date: Jun 2016
Posts: 723
Reputation: 8
Default Re: OnPlayerDisconnect

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?
MerryDeer is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OnPlayerDisconnect Help iBeast Scripting Help 5 06/03/2014 03:42 PM
OnPlayerDisconnect TLN Scripting Help 5 27/02/2014 10:51 PM
[Ajuda] OnPlayerDisconnect _LorD_ Português/Portuguese 3 23/07/2012 02:43 PM
Help me OnPlayerDisconnect kingchandio Help Archive 1 31/07/2011 09:44 AM


All times are GMT. The time now is 10:23 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.