05.05.2016, 16:22
Quote:
|
Try to use crashdetect to detect what cause the crash, I believe OnPlayerDisconnect can cause the crash, or some other callback or function which gets called when the client disconnects or GM is restarted
You should use crash detect once. |
Код:
public OnPlayerDisconnect(playerid, reason)
{
// destroyCar(playerid);
LeaveZone(playerid);
RemoveAdminVehicle(playerid);
RemoveDisco(playerid);
RemoveSiren(playerid);
NeonRemoved(playerid);
DestroyCmds(playerid);
DistroyStatss(playerid);
DistroyRules(playerid);
DestroySpeedometerTextdraw(playerid);
Delete3DTextLabel(alabel[playerid]);
PlayerTextDrawDestroy(playerid, ImageOnConnect[playerid]);
HideMathQuizForPlayer(playerid);
if(pInfo[playerid][Logged] == 1)
{
OnlineStatus[playerid] = 0;
if(SurviveEvent[playerid] == 1)
{
PlayerSurvive--;
KillTimer(SEvent[playerid]);
SurviveEvent[playerid] = 0;
LatestMessageTextdraw( "~y~LMS Event is going on [Total Players Left %d].",PlayerSurvive,0);
}
switch(reason)
{
case 0: format(Jstring, 128, "Leave : %s has left the server. "COL_YELLOW"[Timeout]", GetName(playerid));
case 1: format(Jstring, 128, "Leave : %s has left the server. "lightblue1"[Leaving]", GetName(playerid));
case 2: format(Jstring, 128, "Leave : %s has left the server. "COL_RED"[Kicked]" , GetName(playerid));
}
SCMToAll(0xAFAFAFAA, Jstring);
if(AdminDuty[playerid] != 1 && pInfo[playerid][HasSetAdminName] != true)
{
SavePlayerStats(playerid);
}
}
PlayerTextDrawDestroy(playerid,qtext[playerid]);
for(new i = 0 ; i < 13 ; i++ )
{
PlayerTextDrawHide(playerid,qlog[i][playerid]);
PlayerTextDrawDestroy(playerid,qlog[i][playerid]);
}
if(Spy[playerid] == 1 )
{
Spy[playerid]=0;
KillTimer(ARTimer[playerid]);
}
if(Cover[playerid] == 1)
{
DestroyObject(CObject[playerid]);
Cover[playerid] = 0;
}
if(CbugWarnings[playerid] > 0)
CbugWarnings[playerid] = 0;
if(GetPVarInt(playerid,"MapHidden") == 1 || pInfo[playerid][NameTagHidden] == 1)
KillTimer(pHideTimer[playerid]);
if(pInfo[playerid][Frozen] == 1)
KillTimer(Ftimer[playerid]);
if(pInfo[playerid][Muted] == 1)
KillTimer(Mtimer[playerid]);
if(pInfo[playerid][SpawnedCars] > 0)
{
for(new i=0; i<pInfo[playerid][SpawnedCars]; i++)
{
DestroyVehicle(pInfo[playerid][Cars][i]);
}
pInfo[playerid][SpawnedCars] = 0;
}
if(pInfo[playerid][Locked] == 1)
{
foreach(Player, i)
SetVehicleParamsForPlayer(GetPVarInt(playerid,"CarID"),i,false,false);
pInfo[playerid][Locked] = 0;
Delete3DTextLabel(vLocked3DT[playerid]);
}
if(reconnect[playerid] == 1)
{
new ip[16],string[50];
GetPVarString(playerid, "MYIP", ip, 16);
format(string,sizeof(string),"unbanip %s", ip);
SendRconCommand(string);
reconnect[playerid] = 0;
}
#if SpecTextDraw == true
PlayerTextDrawHide(playerid, SpecPTD[playerid]);
PlayerTextDrawDestroy(playerid, SpecPTD[playerid]);
#endif
foreach(Player, i)
{
if (Specid[i] == playerid && pInfo[i][Spec] == 1)
{
TogglePlayerSpectating(i, 0);
GameTextForPlayerEx(i,"~G~Player ~R~Disconnected",2000,3);
}
}
GotHit[playerid]=0;
if(floorEnable[playerid]==1){DestroyObject(floor[playerid]);return 1;}
return 1;
}
public OnGameModeExit()
{
mysql_close(mysql);
DestroyLatestMessage();
DestroyMathTextdraws();
KillTimer(LMSTIMER);
KillTimer(LmsTimer2);
KillTimer(OnPlayerCheatTimer);
KillTimer(UpdateTimer);
KillTimer(LatestMessageTime);
KillTimer(TreasureTimer);
KillTimer(MathTimer);
TextDrawDestroy(EventTimer);
TextDrawDestroy(Kill1);
TextDrawDestroy(Kill2);
foreach(Player, i)
{
if(pInfo[i][pLevel] > 0 && pInfo[i][Spec] == 1)
{
PlayerTextDrawHide(i, SpecPTD[i]);
PlayerTextDrawDestroy(i, SpecPTD[i]);
PlayerTextDrawHide(i, SpecGTD[i]);
PlayerTextDrawDestroy(i, SpecGTD[i]);
}
PlayerTextDrawDestroy(i, ImageOnConnect[i]);
PlayerTextDrawDestroy(i,qtext[i]);
for(new j = 0 ; j < 13 ; j++ )
{
PlayerTextDrawHide(i,qlog[j][i]);
PlayerTextDrawDestroy(i,qlog[j][i]);
}
KillTimer(SpeedTimer[i]);
KillTimer(SEvent[i]);
KillTimer(LATimer[i]);
KillTimer(WTimer[i]);
KillTimer(XTimer[i]);
KillTimer(Jailtimer[i]);
KillTimer(ARTimer[i]);
KillTimer(AntiSpawn[i]);
KillTimer(Mtimer[i]);
KillTimer(Ftimer[i]);
KillTimer(HeadshotTimer[i]);
KillTimer(Dialogsonconnect[i]);
KillTimer(CmdCount[i]);
KillTimer(ChatCount[i]);
KillTimer(MapLoading[i]);
KillTimer(Cmdtimer[i]);
KillTimer(JPlayer[i]);
KillTimer(DiscoTimer[i]);
KillTimer(RobbingTimer[i]);
KillTimer(Ftimer[i]);
}
//KillTimer(timer[i][PlaceID]);
//KillTimer(RobPlaceAvailableTimer[PlaceID]);
return 1;
}
And now i commented my all OnPlayerDisconnect and OnGameModeEx still crashe..


