Too much CPU usage
#9

First, remove that code in OnPlayerUpdate.

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;
}
Reply


Messages In This Thread
Too much CPU usage - by Rickzor14 - 11.03.2011, 14:33
Re: Too much CPU usage - by Stefan_Toretto - 11.03.2011, 14:35
Re: Too much CPU usage - by Rickzor14 - 11.03.2011, 14:37
Re: Too much CPU usage - by Stefan_Toretto - 11.03.2011, 14:41
Re: Too much CPU usage - by Rickzor14 - 11.03.2011, 14:50
Re: Too much CPU usage - by Stefan_Toretto - 11.03.2011, 14:53
Re: Too much CPU usage - by Rickzor14 - 11.03.2011, 14:54
Re: Too much CPU usage - by JernejL - 11.03.2011, 16:19
Re: Too much CPU usage - by Gh0sT_ - 11.03.2011, 16:44
Re: Too much CPU usage - by sciman001 - 12.03.2011, 18:52

Forum Jump:


Users browsing this thread: 1 Guest(s)