25.11.2017, 04:53
There is a error i get when i use crashdetect i dont know why and i dont know what causes it but i compile the GM with debug mode and it tells me the error is unber player disconnect, now to my knowledge i dont see any thing wrong with my OnPlayerDisconnect callback but i will still post both the error i get from crash detect and the OnPlayerDisconnect callback below.
This is the error
This is the error
PHP код:
[debug] Run time error 6: "Invalid instruction"
[debug] Unknown opcode 0x1064330 at address 0x00000039
[debug] AMX backtrace:
[debug] #0 00000039 in public OnPlayerDisconnect () at <unknown file>:0
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;
}