OnPlayerDisconnect [REP++++++++]
#1

Please this is very improtant for me.....
First here is the codes that under onplayerdisconnect
PHP код:
public OnPlayerDisconnect(playeridreason)
{
    new 
name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME], PlayerIP[16];
    
GetPlayerName(playeridnamesizeof(name));
    
GetPlayerIp(playeridPlayerIPsizeof(PlayerIP));
    if(
reason == 0)
     {
        
format(stringsizeof(string), "%s left the server (Timeout)"name);
        
SendToPlayers(COLOR_GRAYstring);
        
format(stringsizeof(string), "%s left the server (Timeout) (%s)"namePlayerIP);
        
SendToAdmins(COLOR_GRAYstring);
    }
    else if(
reason == 1)
     {
        
format(stringsizeof(string), "%s left the server"name);
        
SendToPlayers(COLOR_GRAYstring);
         
format(stringsizeof(string), "%s left the server (%s)"name,PlayerIP);
        
SendToAdmins(COLOR_GRAYstring);
    }
    else
     {
        
format(stringsizeof(string), "%s left the server (Kicked)"name);
        
SendToPlayers(COLOR_GRAYstring);
         
format(stringsizeof(string), "%s left the server (Kicked) (%s)"namePlayerIP);
        
SendToAdmins(COLOR_GRAYstring);
    }
    new 
INI:File INI_Open(UserPath(playerid));
    
INI_SetTag(File,"data");
    
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
    
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
    
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
    
INI_WriteInt(File,"Skin",GetPlayerSkin(playerid));
    
INI_WriteInt(File,"Ban",PlayerInfo[playerid][pBan]);
    
INI_WriteInt(File,"Score",GetPlayerScore(playerid));
    
INI_WriteInt(File,"Police",PlayerInfo[playerid][pPolice]);
    
INI_WriteInt(File,"Freeze",PlayerInfo[playerid][pFreeze]);
    
INI_WriteInt(File,"Gang",PlayerInfo[playerid][pGang]);
    
INI_WriteInt(File,"Color"GetPlayerColor(playerid));
    
INI_WriteInt(File,"Armour"GetPlayerArmour(playerid));
    
INI_WriteInt(File,"Health"GetPlayerHealth(playerid));
    
INI_WriteInt(File"Horseshoes"PlayerInfo[playerid][pHorseshoes]);
    
INI_WriteInt(File,"Ammo"GetPlayerAmmo(playerid));
    
INI_Close(File);
    
LoggedIn[playerid] = false;
    return 
1;

btw SendToAdmin is a stock made by us

And when the player disconnect from the server it apear at the console
PHP код:
[14:19:28] [debugRun time error 4"Array index out of bounds"
[14:19:28] [debug]  Accessing element at index 1286240 past array upper bound 1
[14:19:28] [debugAMX backtrace:
[
14:19:28] [debug#0 0001a38c in ?? (1286240) from FM.amx
[14:19:28] [debug#1 0002230c in public Itter_OnPlayerDisconnect (0, 1) from FM.amx
[14:19:28] [debug#2 native CallLocalFunction () from samp-server.exe
[14:19:28] [debug#3 0001d990 in public S@@_OnPlayerDisconnect (0, 1, 33554432) from FM.amx
[14:19:28] [debug#4 native CallLocalFunction () from samp-server.exe
[14:19:28] [debug#5 0000d520 in ?? (0, 1) from FM.amx
[14:19:28] [debug#6 000003d8 in public OnPlayerDisconnect (0, 1) from FM.amx
[14:19:28] [partNezoo has left the server (0:1
This prevent me from saving any player data
Please Help
REP+++++
Reply


Messages In This Thread
OnPlayerDisconnect [REP++++++++] - by nezo2001 - 21.01.2015, 11:43
Respuesta: OnPlayerDisconnect [REP++++++++] - by JuanStone - 21.01.2015, 11:54
Re: OnPlayerDisconnect [REP++++++++] - by nezo2001 - 21.01.2015, 12:00
Re: OnPlayerDisconnect [REP++++++++] - by PT - 21.01.2015, 13:10
Re: OnPlayerDisconnect [REP++++++++] - by nezo2001 - 21.01.2015, 13:15

Forum Jump:


Users browsing this thread: 1 Guest(s)