15.05.2015, 13:30
hello, i have cmd /admins
i want make system where type cmd /admins, server send me dialog where is list of online admins. but sorting him from higher to lower admin level. like:
Admin1, level:6
admin2, level:6
admin3, level:5
admin4, level:4
admin5, level:3
... ....
now sorting him from ID like:
Admin5[ID:0], level:4
Admin3:[ID:1], level:5
Admin1;[ID:2], level:6
here is cmd for /admins:
i want make system where type cmd /admins, server send me dialog where is list of online admins. but sorting him from higher to lower admin level. like:
Admin1, level:6
admin2, level:6
admin3, level:5
admin4, level:4
admin5, level:3
... ....
now sorting him from ID like:
Admin5[ID:0], level:4
Admin3:[ID:1], level:5
Admin1;[ID:2], level:6
here is cmd for /admins:
Code:
CMD:admins(playerid, params[]) { if(IsLogged[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "[SERVER]: "COL_WHITE"Moras biti ulogiran kako bi mogao koristiti komande!"); new string[256]; new fstring[64]; new adm = 0; foreach(Player, i) { if(PlayerInfo[i][pAdmin] == 0) adm++; { if(PlayerInfo[i][pAdmin] == 6) { format(fstring, sizeof(fstring),""COL_ORANGE"%s"COL_GREY" [ID: %d] [Admin Level: %d]\n", GetName(i), i, PlayerInfo[i][pAdmin]); strcat(string, fstring, sizeof(string)); } else if(PlayerInfo[i][pAdmin] == 5) { format(fstring, sizeof(fstring),""COL_ORANGE"%s"COL_GREY" [ID: %d] [Admin Level: %d]\n", GetName(i), i, PlayerInfo[i][pAdmin]); strcat(string, fstring, sizeof(string)); } if(adm == 0) return SCM(playerid, COLOR_ORANGE, "[SERVER]: "COL_WHITE"Trenutno nema Admina/Gamemastera online!"); } } ShowPlayerDialog(playerid,DIALOG_ADMINSLISTP,DIALOG_STYLE_MSGBOX,""COL_ORANGE"ONLINE ADMINS",string,"ZATVORI",""); return 1; }