18.05.2020, 23:25
The player's account is not saving properly. Sometime it saves their stats but sometime when they connect to the server, their stat's are gone.
That is the stock i used everytime i need to save their accounts.
pawn Code:
stock SaveStats(playerid)
{
new file[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(file, sizeof(file), "Accounts/%s.ini", name);
if(dini_Exists(file))
{
dini_IntSet(file, "AdminLevel", pInfo[playerid][pAdmin]);
dini_IntSet(file, "VIPLevel", pInfo[playerid][pVIP]);
dini_IntSet(file, "Cash", GetPlayerCash(playerid));
dini_IntSet(file, "Score", GetPlayerScore(playerid));
dini_IntSet(file, "Kills", pInfo[playerid][pKills]);
dini_IntSet(file, "Death", pInfo[playerid][pDeaths]);
dini_Set(file, "IP", GetPlayerIP2(playerid));
dini_IntSet(file, "Banned", pInfo[playerid][pBanned]);
dini_IntSet(file, "Bank", pInfo[playerid][pBank]);
dini_IntSet(file, "Hours", pInfo[playerid][pHours]);
dini_IntSet(file, "Minutes", pInfo[playerid][pMinutes]);
dini_IntSet(file, "Second", pInfo[playerid][pSecond]);
}
return 1;
}