27.04.2014, 05:16
I'm a bit confused as to why this integer is writing multiple times. Any help is appreciated.
This is in the players file when only one should be there.
These are a few stocks and public functions I've created for saving purposes.
This is in the players file when only one should be there.
Код:
Hit Amount = 0 Hit Amount = 0
pawn Код:
stock SaveAccount(playerid)
{
new INI:file = INI_Open(UserPath(playerid));
INI_SetTag(file, "Player Data");
INI_WriteInt(file, "Score", GetPlayerScore(playerid));
INI_WriteInt(file, "Money", GetPlayerMoney(playerid));
INI_WriteInt(file, "Admin", pInfo[playerid][pAdmin]);
INI_WriteInt(file, "Vip", pInfo[playerid][pVip]);
INI_WriteInt(file, "Team", pInfo[playerid][pTeam]);
INI_WriteInt(file, "Skin", GetPlayerSkin(playerid));
INI_WriteInt(file, "Kills", pInfo[playerid][pKills]);
INI_WriteInt(file, "Deaths", pInfo[playerid][pDeaths]);
INI_WriteInt(file, "Wanted", GetPlayerWantedLevel(playerid));
INI_WriteInt(file, "Hit Amount", pInfo[playerid][pHitAmount]);
INI_Close(file);
return 1;
}
public LoadAccount_data(playerid, name[], value[])
{
INI_Int("Password", pInfo[playerid][pPass]);
INI_Int("Score", pInfo[playerid][pScore]);
INI_Int("Money", pInfo[playerid][pMoney]);
INI_Int("Admin", pInfo[playerid][pAdmin]);
INI_Int("Vip", pInfo[playerid][pVip]);
INI_Int("Team", pInfo[playerid][pTeam]);
INI_Int("Skin", pInfo[playerid][pSkin]);
INI_Int("Kills", pInfo[playerid][pKills]);
INI_Int("Deaths", pInfo[playerid][pDeaths]);
INI_Int("Wanted", pInfo[playerid][pWanted]);
INI_Int("Hit Amount", pInfo[playerid][pHitAmount]);
return 1;
}
//And when they register on the proper dialog.
new INI:file = INI_Open(UserPath(playerid));
INI_SetTag(file, "Player Data");
INI_WriteInt(file, "Password", udb_hash(inputtext));
INI_WriteInt(file, "Admin", 0);
INI_WriteInt(file, "Score", 0);
INI_WriteInt(file, "Money", 0);
INI_WriteInt(file, "Vip", 0);
INI_WriteInt(file, "Team", 0); //temp
INI_WriteInt(file, "Skin", 0);
INI_WriteInt(file, "Kills", 0);
INI_WriteInt(file, "Deaths", 0);
INI_WriteInt(file, "Wanted", 0); //not wanted upon register.
INI_WriteInt(file, "Hit Amount", 0); //Doesn't have a bounty
INI_Close(file);