03.02.2014, 20:28
Hey, i'm trying to make a command which shows all staff, just getting a error. Don't know what im doing wrong.
I got a single /admins and /mods command working, I just don't know how to get them in line, it needs to show the admins first then the moderators, how to do that?
Thanks!
Код:
YCMD:staff(playerid, params[], help) { if(help) return SCM(playerid, COLOR_GREY, "Not supported"); new string[256], sendername[MAX_PLAYER_NAME]; GetPlayerName(playerid, sendername, sizeof(sendername)); if(IsPlayerConnected(playerid)) { SCM(playerid, COLOR_YELLOW, "Admins"); foreach(new i : Player) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] <= 6) { new admtext[64]; if(PlayerInfo[i][pAppearList] == 1 || PlayerInfo[i][pAppearList] == 0) { if(PlayerInfo[i][pAdmin] == 6) { admtext = "Admin Level 6"; } else if(PlayerInfo[i][pAdmin] == 5) { admtext = "Admin Level 5"; } else if(PlayerInfo[i][pAdmin] == 4) { admtext = "Admin Level 4"; } else if(PlayerInfo[i][pAdmin] == 3) { admtext = "Admin Level 3"; } else if(PlayerInfo[i][pAdmin] == 2) { admtext = "Admin Level 2"; } else if(PlayerInfo[i][pAdmin] == 1) { admtext = "Admin Level 1"; } } GetPlayerName(i, sendername, sizeof(sendername)); if(PlayerInfo[i][pAdminDuty] == 0) { format(string, sizeof(string), "%s: %s", admtext, sendername); SCM(playerid, COLOR_GRAD, string); } else if(PlayerInfo[i][pAdminDuty] == 1) { format(string, sizeof(string), "%s: %s - On Duty", admtext, sendername); SCM(playerid, COLOR_GRAD, string); } } } } if(IsPlayerConnected(playerid)) { SCM(playerid, COLOR_YELLOW, "Mods"); foreach(new i : Player) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pMod] == 1) { new admtext[64]; if(PlayerInfo[i][pAppearList] == 1 || PlayerInfo[i][pAppearList] == 0) { if(PlayerInfo[i][pMod] == 1) { admtext = "Moderator"; } } GetPlayerName(i, sendername, sizeof(sendername)); if(PlayerInfo[i][pModDuty] == 0) { format(string, sizeof(string), "%s: %s", admtext, sendername); SCM(playerid, COLOR_GRAD, string); } else if(PlayerInfo[i][pModDuty] == 1) { format(string, sizeof(string), "%s: %s - On Duty", admtext, sendername); SCM(playerid, COLOR_GRAD, string); } } } } } return 1; }
Thanks!