25.06.2017, 09:28
hey guys, i've made a simple /makeadmin cmd that looks like that:
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!
Код:
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; }