16.02.2017, 14:03
Hello i wanna make like in /admins
Admininstrators and very important players in same list
my code
Admininstrators and very important players in same list
my code
Код:
CMD:admins(playerid) { if(pLogged[playerid] == false) return Error(playerid, "You must be registered to use this command! (/register)"); new count; foreach(Player, ii) { if(pAdmin[ii] > 0 && pHidden[ii] == 0) count++; } if(count == 0) { //SendClientMessage(playerid, COLOR_GREY, ""OSF" "GREY_E"There are no administrators online."); //SendClientMessage(playerid, COLOR_GREY, ""OSF" "GREY_E"Use /report if you suspect a player of cheating."); GameTextForPlayer(playerid,"~Y~NO ADMINS ONLINE",2000,3); if(pAdmin[playerid] >= 1) ShowHiddenAdmins(playerid); return true; } new line3[900], displayed; if(count == 1) { str = ""BLUE_E"OSF: {FFFFFF}Admins"; line3 = ""WHITE_E"Total of "YELLOW_E"1 "WHITE_E"Admin online:\n"; } else { format(str, sizeof(str), ""BLUE_E"OSF: {FFFFFF}Admins"); format(line3, sizeof(line3), ""WHITE_E"Total of "YELLOW_E"%d "WHITE_E"Admin online:\n", count); } foreach(Player, ii) { GetPlayerName(ii, PlayerName, sizeof(PlayerName)); if(pAdmin[ii] > 0 && pHidden[ii] == 0) { switch(pAdmin[ii]) { case 1: tmp = ""WHITE_E"(Moderator)"; case 2: tmp = ""WHITE_E"(Administrator)"; case 3: tmp = ""WHITE_E"(Lead Administrator)"; case 4: tmp = ""WHITE_E"(Head Administrator)"; case 5: tmp = ""WHITE_E"(Executive Administrator)"; } if(displayed == 0) { if(cAFK[ii] > 20) { format(line3, sizeof(line3), "%s\n"YELLOW_E"%s %s "WHITE_E"[AFK]", line3, PlayerName, tmp); } else format(line3, sizeof(line3), "%s\n"YELLOW_E"%s %s", line3, PlayerName, tmp); } else { if(cAFK[ii] > 20) { format(line3, sizeof(line3), "%s\n"YELLOW_E"%s %s "WHITE_E"[AFK]", line3, PlayerName, tmp); } else format(line3, sizeof(line3), "%s\n"YELLOW_E"%s %s", line3, PlayerName, tmp); } displayed = displayed + 1; } } format(line3, sizeof(line3), "%s\n\n\n"WHITE_E"To report a hacker, use "YELLOW_E"/report!\n\n"GREY2_E"Do not PM any admins for no reason.\nThe server is also being watched from IRC.", line3); ShowPlayerDialog(playerid, 16, DIALOG_STYLE_MSGBOX, str, line3, "Close", ""); if(pAdmin[playerid] >= 2) ShowHiddenAdmins(playerid); return true; }