SA-MP Forums Archive
How to fix data Clearing ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to fix data Clearing ? (/showthread.php?tid=316420)



How to fix data Clearing ? - ServerScripter - 06.02.2012

Hi , i find something in my register/login system , whene a player disconnect it clear the Cash+score+.....(exept the password)
this is the public onplayerdisconnect;
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new file[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    format(file, sizeof(file), "LATDM/users/%s.ini", name);
    if(dini_Exists(file)) {
        //      dini_IntSet(file, "pw", PlayerInfo[playerid][pw]);
        dini_IntSet(file, "AdminLevel", PlayerInfo[playerid][AdminLevel]);
        dini_IntSet(file, "VipLevel", PlayerInfo[playerid][VipLevel]);
        dini_IntSet(file, "cash", PlayerInfo[playerid][cash]);
        dini_IntSet(file, "score", PlayerInfo[playerid][score]);
    }
    return 1;
}