21.03.2013, 14:12
How do I save custom things using YSI/Y_ini. I got fully working save and load system but how do I for example enable the player to save custom things.
Example:
How do I set it so it writes the file upon purchase?
Should I just add like
And then like on loadaccountdata
Example:
Код:
CMD:buyme(playerid, params[]) { if(!strcmp(params, "meh", true)) { if(GetPlayerMoney(playerid, < 3000) { GivePlayerMoney(playerid, -3000); SendClientMessage(playerid, COLOR_YELLOW, "<!>Purchased meh!"); //what here? } else { SendClientMessage(playerid, COLOR_RED, "<!>Not enough money for this!"); } return 1; } return 1; }
Код:
enum PlayerInfo { Pass[129], Adminlevel, VIPlevel, Money, Scores, Kills, Deaths, meh //This one is the one that I want to save. } new pInfo[MAX_PLAYERS][PlayerInfo];
Should I just add like
Код:
pInfo[playerid][meh]++;
Код:
INI_Int("Meh",pInfo[playerid][mah]);