giving names to values
#1

hey guys, i've made a simple /makeadmin cmd that looks like that:
Код:
CMD:makeadmin(playerid, params[])
{
	if(IsPlayerAdmin(playerid))
	{
	    new id, level, string[126];
		if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, COL_SYSTEM, "* Syntax: /makeadmin "COLOR_ORANGE"[TargetID] [Level 1-1336]"COLOR_SYSTEM" *");
		PlayerInfo[id][pAdmin] = level;
		format (string, sizeof(string), "* System: "COLOR_ORANGE"[Administrator] - %s"COLOR_SYSTEM" has set your admin level to "COLOR_ORANGE"%d"COLOR_SYSTEM". *", GetNameEx(playerid), level);
	    SendClientMessage(id, COL_SYSTEM, string);
	    format (string, sizeof(string), "* System: You have set "COLOR_ORANGE"%s's"COLOR_SYSTEM" admin level to "COLOR_ORANGE"%d"COLOR_SYSTEM". *", GetNameEx(id), level);
	    SendClientMessage(playerid, COL_SYSTEM, string);
	}
	else
	{
	    SendClientMessage(playerid, COL_SYSTEM, "* System: You are "COLOR_LIGHTRED"not allowed"COLOR_SYSTEM" to use this command! *");
	}
	return 1;
}
my question is how can i make the levels which appear as %d to appear as names aka junior admin senior admin etc..? thanks in advance!
Reply


Messages In This Thread
giving names to values - by MrCesar - 25.06.2017, 09:28
Re: giving names to values - by Vince - 25.06.2017, 09:39
Re: giving names to values - by SyS - 25.06.2017, 09:39
Re: giving names to values - by Whatname - 25.06.2017, 09:42
Re: giving names to values - by MrCesar - 25.06.2017, 10:37
Re: giving names to values - by Whatname - 25.06.2017, 11:43
Re: giving names to values - by MrCesar - 25.06.2017, 12:06
Re: giving names to values - by UnlikePluto - 25.06.2017, 12:45

Forum Jump:


Users browsing this thread: 1 Guest(s)