11.10.2015, 11:25
Quote:
Instead of defining 5 levels, why not simply create a multidimensional array?
|
Код:
CMD:admins(playerid, params[]) { new string[128], count, rank[35]; if(GetPlayerScore(playerid) < 50) return Error(playerid, "You need 50 score to use this command"); LOOP_PLAYERS(i) { count = 0; if(IsPlayerAdminEx(i) || IsPlayerAdmin(i)) { count++; if(IsPlayerAdmin(i)) rank = "RCON Admin"; else { switch(GetLevel(i)) { case 1: rank = ""LEVEL1""; case 2: rank = ""LEVEL2""; case 3: rank = ""LEVEL3""; case 4: rank = ""LEVEL4""; case 5: rank = ""LEVEL5""; } } format(string, sizeof(string), ""white"%i. %s(%i) - "orange"(%s)", count, GetName(i), i, rank); Dialog_Show(playerid, dialogUnused, DIALOG_STYLE_MSGBOX, "Online Admins", string, "Close", ""); } } if(count == 0) return Error(playerid, "There are currently no admins online"); return 1; }