Crashdetect problem when Logging out
#4

PHP код:
public OnPlayerDisconnect(playeridreason)
{
    new 
sz_String[128];
    
    switch(
reason)
    {
        case 
0format(sz_Stringsizeof(sz_String), "%s[ID:%d] {FF0000}загуби връзка. {ffffff}(Crash)",PlayerName(playerid),playerid);
        case 
1format(sz_Stringsizeof(sz_String), "%s[ID:%d] {FF0000}излезе от сървъра. {ffffff}(Leave)",PlayerName(playerid),playerid);
        case 
2format(sz_Stringsizeof(sz_String), "%s[ID:%d] {FF0000}беше кикнат от сървъра. {ffffff}(Kick)",PlayerName(playerid),playerid);
    }
    
SendClientMessageToAll(-1sz_String);
    
    if(
CreatedRamp[playerid] == trueDestroyObject(Ramp[playerid]), CreatedRamp[playerid] = false;
    
CreatedRamp[playerid] = false;
    
RampEnabled[playerid] = 0;
    
Pers[playerid] = 0;
    
    new 
INI:playerFile INI_Open(UserPath(playerid));
    
INI_SetTag(playerFile,"PData");
    
INI_WriteInt(playerFile"Admin"PlayerInfo[playerid][pAdmin]);
    
INI_WriteInt(playerFile"Deaths"PlayerInfo[playerid][pDeaths]);
    
INI_WriteInt(playerFile"Cash"GetPlayerCash(playerid));
    
INI_WriteInt(playerFile"Kills"PlayerInfo[playerid][pKills]);
    
INI_WriteInt(playerFile"VIP"PlayerInfo[playerid][pVIP]);
    
INI_WriteInt(playerFile"VIPExpire"PlayerInfo[playerid][pVIPExpire]);
    
INI_WriteInt(playerFile"Muted"PlayerInfo[playerid][pMuted]);
    
INI_WriteInt(playerFile"TruckerSkills"PlayerInfo[playerid][pTruckerSkills]);
    
INI_WriteInt(playerFile"Level"GetPlayerScore(playerid));
    
INI_WriteInt(playerFile"Exp"PlayerInfo[playerid][pExp]);
    
INI_WriteInt(playerFile"Job"PlayerInfo[playerid][pJob]);
    
INI_WriteInt(playerFile"Jailed"PlayerInfo[playerid][pJailed]);
    
INI_WriteInt(playerFile"JailTime"PlayerInfo[playerid][pJailTime]);
    
INI_WriteInt(playerFile"Warns"PlayerInfo[playerid][pWarns]);
    
INI_WriteInt(playerFile"HouseKey"PlayerInfo[playerid][pHouseKey]);
    
INI_WriteInt(playerFile"Leader"PlayerInfo[playerid][pLeader]);
    
INI_WriteInt(playerFile"Member"PlayerInfo[playerid][pMember]);
    
INI_WriteInt(playerFile"Rank"PlayerInfo[playerid][pRank]);
    
INI_WriteInt(playerFile"SavedSkin"PlayerInfo[playerid][pSavedSkin]);
    
INI_WriteInt(playerFile"UseSkin"PlayerInfo[playerid][pUseSkin]);
    
INI_Close(playerFile);
    
TextDrawHideForPlayer(playerid,ServerTextDrawOne);
    
TextDrawHideForPlayer(playerid,ServerTextDrawTwo);
    
TextDrawHideForPlayer(playerid,ServerTextDrawThree);
      
TextDrawHideForPlayer(playerid,ServerTextDrawFour[playerid]);
      
TextDrawHideForPlayer(playerid,ServerTextDrawFive[playerid]);
      
TextDrawHideForPlayer(playerid,ServerTextDrawSix[playerid]);
       
TextDrawSetString(ServerTextDrawFour[playerid]," ");
       
TextDrawSetString(ServerTextDrawFive[playerid]," ");
       
TextDrawSetString(ServerTextDrawSix[playerid]," ");
       
      
TextDrawHideForPlayer(playerid,LevelTXD[playerid]);
      
TextDrawHideForPlayer(playerid,ExpTXD[playerid]);
       
    
DriftMoney[playerid] = 0;
    
DriftScore[playerid] = 0;
    
DriftPoints[playerid] = 1;
    
PlayerPositionX[playerid] = 0.0;
    
PlayerPositionY[playerid] = 0.0;
    
PlayerPositionZ[playerid] = 0.0;
    
Laser[playerid] = 0;
    
InDM[playerid] = 0;
    
NoGoto[playerid] = 0;
    
NoPM[playerid] = 0;
    
LastPM[playerid] = -1;
    
GodMode[playerid] = 0;
    
NameTag[playerid] = 0;
    
RampEnabled[playerid] = 0;
    
Pers[playerid] = 0;
    
IsAFK[playerid] = 0;
    
CP[playerid] = 0;
    
RemovePlayerAttachedObject(playerid0);
    
KillTimer(PlayerTimerOne[playerid]);
    
    if(
PlayerInfo[playerid][pMuted] >= 1)
    {
        new 
string[128];
        
format(stringsizeof(string), "AdmWarn: %s напусна сървъра с оставащо време от това, че беше заглушен %d минути."PlayerName(playerid), PlayerInfo[playerid][pMuted]);
        foreach(new 
Player)
        {
            if (
IsPlayerConnected(i))
            {
                
AdminMessage(COLOR_ADMCMDstring);
            }
        }
    }
    
    
HideSpawnTextdraws(playerid);
    
HideAFKTextdraws(playerid);
    return 
1;

Reply


Messages In This Thread
Crashdetect problem when Logging out - by RenSoprano - 29.04.2015, 08:11
Re: Crashdetect problem when Logging out - by AzaMx - 29.04.2015, 08:45
Re: Crashdetect problem when Logging out - by Evocator - 29.04.2015, 09:34
Re: Crashdetect problem when Logging out - by RenSoprano - 29.04.2015, 10:40

Forum Jump:


Users browsing this thread: 2 Guest(s)