22.06.2012, 02:36
Good evening everyone. I've managed to save everything else, except the score for the player. How could I do this, with Y_INI? Here's my current enum.
And when a player gets a score, do I need to do like...
?
Because this is what I have so far.
and it doesn't save. And when a player connects/disconnects, I have added this to the code.
and on disconnect
What am I doing wrong? Any help is greatly appreciated.
pawn Код:
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("Frozen",PlayerInfo[playerid][pFrozen]);
INI_Int("Mute",PlayerInfo[playerid][pMute]);
INI_Int("Cookies",PlayerInfo[playerid][pCookies]);
INI_Int("Vip",PlayerInfo[playerid][pVip]);
INI_Int("TempVip",PlayerInfo[playerid][pTempVip]);
INI_Int("Beta",PlayerInfo[playerid][pBeta]);
INI_Int("Warns",PlayerInfo[playerid][pWarns]);
INI_Int("Ban",PlayerInfo[playerid][pBan]);
INI_Int("Score",PlayerInfo[playerid][pScore]);
pawn Код:
PlayerInfo[playerid][pScore] +=2;
Because this is what I have so far.
pawn Код:
SetPlayerScore(playerid,GetPlayerScore(playerid) +5);
PlayerInfo[playerid][pScore] +=5;
pawn Код:
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
pawn Код:
INI_WriteInt(File,"Score",GetPlayerScore(playerid));
INI_Close(File);