data saving problem
#5

here is my saveuser
Code:
stock SavePlayer(playerid)
{
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
    INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
    INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
    INI_WriteInt(File,"WantedLevel",GetPlayerWantedLevel(playerid));
    INI_WriteInt(File,"Vip",PlayerInfo[playerid][pVip]);
    INI_WriteInt(File,"Score",GetPlayerScore(playerid));
    INI_WriteInt(File,"Condoms",PlayerInfo[playerid][pCondoms]);
    INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBanned]);
    INI_WriteInt(File,"Jailed",PlayerInfo[playerid][pJailed]);
    INI_WriteInt(File,"Drugs",PlayerInfo[playerid][pDrug]);
    INI_WriteInt(File,"Nopm",PlayerInfo[playerid][pNopm]);
    INI_WriteInt(File,"Bank",PlayerInfo[playerid][pBank]);
    INI_WriteInt(File,"Sausages",PlayerInfo[playerid][pSausage]);
    INI_WriteInt(File,"PassChange",PlayerInfo[playerid][pPassChange]);
    INI_WriteInt(File,"Mute",PlayerInfo[playerid][pMuted]);
    INI_Close(File);
}
here is my saveallstats
Code:
public SaveAllStats()
{
	for(new i=0;i<MAX_PLAYERS;i++)
    {
    new INI:File = INI_Open(UserPath(i));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Cash",GetPlayerMoney(i));
    INI_WriteInt(File,"Admin",PlayerInfo[i][pAdmin]);
    INI_WriteInt(File,"Kills",PlayerInfo[i][pKills]);
    INI_WriteInt(File,"Deaths",PlayerInfo[i][pDeaths]);
    INI_WriteInt(File,"WantedLevel",GetPlayerWantedLevel(i));
    INI_WriteInt(File,"Vip",PlayerInfo[i][pVip]);
    INI_WriteInt(File,"Score",GetPlayerScore(i));
    INI_WriteInt(File,"Condoms",PlayerInfo[i][pCondoms]);
    INI_WriteInt(File,"Banned",PlayerInfo[i][pBanned]);
    INI_WriteInt(File,"Jailed",PlayerInfo[i][pJailed]);
    INI_WriteInt(File,"Drugs",PlayerInfo[i][pDrug]);
    INI_WriteInt(File,"Nopm",PlayerInfo[i][pNopm]);
    INI_WriteInt(File,"Bank",PlayerInfo[i][pBank]);
    INI_WriteInt(File,"Sausages",PlayerInfo[i][pSausage]);
    INI_WriteInt(File,"PassChange",PlayerInfo[i][pPassChange]);
    INI_WriteInt(File,"Mute",PlayerInfo[i][pMuted]);
    INI_Close(File);
    }
    SendClientMessageToAll(-1,"Players data have been {F70505}auto saved.");
}
Here Is My LoadUser_Data
Code:
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][pPass]);
    INI_Int("Cash",PlayerInfo[playerid][pCash]);
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    INI_Int("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    INI_Int("WantedLevel",PlayerInfo[playerid][pWantedLevel]);
    INI_Int("Vip",PlayerInfo[playerid][pVip]);
    INI_Int("Score",PlayerInfo[playerid][pScore]);
    INI_Int("Condoms",PlayerInfo[playerid][pCondoms]);
    INI_Int("Banned",PlayerInfo[playerid][pBanned]);
    INI_Int("Jailed",PlayerInfo[playerid][pJailed]);
    INI_Int("Drugs",PlayerInfo[playerid][pDrug]);
    INI_Int("Nopm",PlayerInfo[playerid][pNopm]);
    INI_Int("Bank",PlayerInfo[playerid][pBank]);
    INI_Int("Sausages",PlayerInfo[playerid][pSausage]);
    INI_Int("PassChange",PlayerInfo[playerid][pPassChange]);
    INI_Int("Mute",PlayerInfo[playerid][pMuted]);
    return 1;
}
Reply


Messages In This Thread
data saving problem - by CarRamper - 14.06.2016, 15:46
Re: data saving problem - by SyS - 14.06.2016, 15:47
Re: data saving problem - by CarRamper - 14.06.2016, 16:18
Re: data saving problem - by SyS - 14.06.2016, 16:20
Re: data saving problem - by CarRamper - 14.06.2016, 16:42
Re: data saving problem - by SyS - 23.06.2016, 16:26

Forum Jump:


Users browsing this thread: 1 Guest(s)