11.03.2011, 16:44
First, remove that code in OnPlayerUpdate.
And add in OnPlayerDisconnect:
And add in OnPlayerDisconnect:
pawn Code:
public OnPlayerDisconnect( playerid, reason )
{
if( AccountInfo[ playerid ][ aLogged ] == 1 )
{
new
File[ 60 ],
Name[ 24 ]
;
GetPlayerName( playerid, Name, 24 );
format( File, 60, ACCOUNTS_FOLDER, playername3);
new
File: hFile = fopen( File, io_write )
;
if( hFile )
{
new
Variable[ 65 ],
IP[ 16 ]
;
GetPlayerIp( playerid, IP, 16 );
format( Variable, 65, "Password=%s\n", AccountInfo[ playerid ][ aPassword ] ), fwrite( File, Variable );
format( Variable, 24, "IP=%s\n", IP ), fwrite( File, Variable );
format( Variable, 12, "Level=%i\n", AccountInfo[ playerid ][ aLevel ] ), fwrite( File, Variable );
format( Variable, 22, "Score=%i\n", GetPlayerScore( playerid ), fwrite( File, Variable );
format( Variable, 22, "Money=%d\n", GetPlayerMoney( playerid ), fwrite( File, Variable );
format( Variable, 26, "Airstrike=%i\n", airstrike[ playerid ] ), fwrite( File, Variable );
format( Variable, 26, "Landmines=%i\n", LandMines[ playerid ] ), fwrite( File, Variable );
format( Variable, 21, "Rank=%i\n", Rank[ playerid ] ), fwrite( File, Variable );
fclose( File );
}
}
return true;
}