25.11.2017, 14:13
Quote:
and more...
Multiple reasons for your problem. Can you post the whole callback here? |
Onplayerdisconnect
PHP код:
SaveChar(playerid);
// for(new a = 0; a < 10; a++) if(IsPlayerAttachedObjectSlotUsed(playerid, a)) RemovePlayerAttachedObject(playerid, a);
new l[56];
if(reason == 0) { l = "TIMED OUT"; }
if(reason == 1) { l = "DISCONNECTED"; }
if(reason == 2) { l = "KICKED / BANNED"; }
new lstr[256];
format(lstr, sizeof(lstr), "%s has left the server. {F81414}(%s)", GetName(playerid), l);
SendClientMessageToAll(0xD4D4D4FF,lstr);
foreach(Player, i)
{
if (Specid[i] == playerid && pInfo[i][Spec] == 1)
{
SpecNext(playerid);
GameTextForPlayerEx(playerid,"~R~Player ~R~Disconnected",2000,3);
}
}
if(Duel[playerid] >=2)
{
if(Maderequest[playerid] == 1)
{
new PID = Duelopponent[playerid];
SpawnPlayer(PID);
KillTimer(UnDuelend[playerid]);
KillTimer(UnDuelend[PID]);
Duel[PID] = 0;
Duelrounds[PID] = 0;
}
else if(Gotrequest[playerid] == 1)
{
new PID = Duelmaker[playerid];
SpawnPlayer(PID);
KillTimer(UnDuelend[playerid]);
KillTimer(UnDuelend[PID]);
Duel[PID] = 0;
Duelrounds[PID] = 0;
}
}
ResetVariables(playerid);
return 1;
}