Saving, GMX and Disconnect
#10

Actually the problem is, that OnPlayerDisconnect gets called, but it get's called too late.

pawn Code:
new GMX = 0;//On top of script

CMD:gmx(playerid, params[])
{
    //blah blah
    GMX = 1;
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
            {
                    SavePlayerData(i);
        }
    }
}

public OnPlayerDisconnect(playerid)
{
    if(GMX == 0)
    {
        SavePlayerData(playerid);
    }
    return 1;
}
Reply


Messages In This Thread
Saving, GMX and Disconnect - by willsuckformoney - 04.11.2012, 21:33
Re: Saving, GMX and Disconnect - by zDivine - 04.11.2012, 21:34
Re: Saving, GMX and Disconnect - by willsuckformoney - 04.11.2012, 21:37
Re: Saving, GMX and Disconnect - by Glad2BeHere - 04.11.2012, 22:01
Re: Saving, GMX and Disconnect - by zDivine - 04.11.2012, 22:04
Re: Saving, GMX and Disconnect - by ReneG - 04.11.2012, 22:05
Re: Saving, GMX and Disconnect - by willsuckformoney - 04.11.2012, 22:06
Re: Saving, GMX and Disconnect - by Glad2BeHere - 04.11.2012, 22:11
Re: Saving, GMX and Disconnect - by ReneG - 04.11.2012, 22:16
Re: Saving, GMX and Disconnect - by JhnzRep - 05.11.2012, 00:39

Forum Jump:


Users browsing this thread: 1 Guest(s)