Dini is too slow to save data under OnPlayerDisconnect?
#1

When the player uses /savestats cmd, his stats save successfully in-game.

pawn Код:
CMD:savestats(playerid, params[])
{
    SendClientMessage(playerid, COLOR_YELLOW, ".:||Stats Saved||:.");
    dini_Set(file, "example0", PlayerInfo[playerid][example0]);
    dini_Set(file, "example1", PlayerInfo[playerid][example1]);
    dini_Set(file, "example2", PlayerInfo[playerid][example2]);
    dini_Set(file, "example3", PlayerInfo[playerid][example3]);
    return 1;
}
But when i put the same thing under OnPlayerDisconnect ( and add if(gPlayerLogged == 1) ) the stats won't save

Under onplayerdisconnect

pawn Код:
format(file, sizeof(file), SERVER_USER_FILE, GetName(playerid));
if(gPlayerLogged[playerid] == 1)
    {
        dini_Set(file, "example0", PlayerInfo[playerid][example0]);
        dini_Set(file, "example1", PlayerInfo[playerid][example1]);
        dini_Set(file, "example2", PlayerInfo[playerid][example2]);
        dini_Set(file, "example3", PlayerInfo[playerid][example3]);
    }
    gPlayerLogged[playerid] = 0;
Any solution?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)