Problem calling "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: Problem calling "OnPlayerDisconnect". (
/showthread.php?tid=486562)
Problem calling "OnPlayerDisconnect". -
Edvin - 09.01.2014
Hello world.
I have few problems with minigames which are on my server. I noticed that once a player get
crash sometimes the "OnPlayerDisconnect" callback don't get called, i think, because the last player remains stuck in the minigame and also the minigame is not restarting, untill i do not use a command to unblock the player and restart the minigame.
I'm using the iterators from foreach include. Any suggestions what should i do?
Thanks.
Re: Problem calling "OnPlayerDisconnect". -
offon - 09.01.2014
Not sure about this one. However, OnPlayerDisconnect you can detect the reason, and the reason 0 or 1 detects if a player crashes. So:
Код:
// OnPlayerDisconnect
switch(reason)
{
case 0:
{
}
case 1:
{
}
case 2:
{
}
}
Re: Problem calling "OnPlayerDisconnect". -
Edvin - 09.01.2014
I will try to reset variables if the reason will be 0 or 1, if this won't work, i'll look carefully in my script to see where i have mistaken.