YSI/Y_ini question
#1

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:
Код:
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];
How do I set it so it writes the file upon purchase?


Should I just add like
Код:
pInfo[playerid][meh]++;
And then like on loadaccountdata
Код:
INI_Int("Meh",pInfo[playerid][mah]);
Reply


Messages In This Thread
YSI/Y_ini question - by Squirrel - 21.03.2013, 14:12
Re: YSI/Y_ini question - by Maxips2 - 21.03.2013, 14:27
Re: YSI/Y_ini question - by Squirrel - 21.03.2013, 14:37

Forum Jump:


Users browsing this thread: 1 Guest(s)