A little issue the y_ini
#5

[QUOTE=RxErT;3999321]So as you're saying it should be like that right?:

Код:
CMD:setgold(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new
             string[400],
             tname[MAX_PLAYER_NAME],
             targetid,
             maxcookies;

		if(sscanf(params, "ii", targetid, maxcookies))
        {
            return SendClientMessage(playerid, 0xF8F8F8FFF, "Syntax: {Ffffff}/setgold <id> <amount>");
        }
        for(new i=0;i<MAX_PLAYERS; i++) continue; {
                 if((!IsPlayerConnected(targetid)) || (targetid == INVALID_PLAYER_ID))
                {
                       SendClientMessage(playerid,-1, "{f00f00}ERROR: {FFFFFF}Player isn't Connected!");
                }
	}
        if(maxcookies < 0 || maxcookies > 100000000)
        {
        	return SendClientMessage( playerid, 0xF8F8F8FFF, "{f00f00}ERROR: {FFFFFF}highest amount is 100000000.");
		}
        else
        {
            GetPlayerName(targetid, tname, sizeof(tname));
            format(string, sizeof(string), "{A9C4E4}an administrator has set %s's golds amount to %i.", tname, maxcookies);
            SendClientMessageToAll(0xF8F8F8FFF, string);
            GameTextForPlayer(targetid,"~W~W~P~O~R~W! ~B~N~G~I~R~C~P~E! ~Y~GOLD! ~R~:)",3000,3);
            PlayerPlaySound(targetid, 17802, 0.0, 0.0, 0.0);
            new INI:File = INI_Open(UserPath(targetid));
            PlayerInfo[targetid][pGold] = maxcookies;
            INI_WriteInt(File,"Gold",maxcookies);
       	    INI_Close(File);
            return 1;
        }
    }
    else
    {
	    SendClientMessage(playerid, 0xf8F8F8FFF,"{F00f00}ERROR: {FFFFFF}You aren't authorized to use this command.");
    }
    return 1;
}
yes you need to save the data whenever you edit it.
Reply


Messages In This Thread
A little issue the y_ini - by RxErT - 03.03.2018, 06:45
Re: A little issue the y_ini - by PepsiCola23 - 03.03.2018, 09:22
Re: A little issue the y_ini - by wallen - 03.03.2018, 09:26
Re: A little issue the y_ini - by RxErT - 03.03.2018, 10:47
Re: A little issue the y_ini - by PepsiCola23 - 03.03.2018, 11:19
Re: A little issue the y_ini - by RxErT - 03.03.2018, 11:54
Re: A little issue the y_ini - by RxErT - 03.03.2018, 13:40

Forum Jump:


Users browsing this thread: 3 Guest(s)