05.12.2011, 09:02
pawn Код:
dcmd_admins(playerid,params[])
{
#pragma unused params
new
count = 0,
string[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if(AccInfo[i][Level] >= 1 && AccInfo[i][Hide] == 0)
{
if(IsPlayerAdmin(i)) AdmRank ="[RCON ADMIN]";
else
{
switch(AccInfo[i][Level])
{
case 1: AdmRank = "{EBE710}[CO-MODERATOR]";
case 2: AdmRank = "{2E10EB}[MODERATOR]";
case 3: AdmRank = "{10EB23}[ADMIN]";
case 4: AdmRank = "{EB105D}[LEADER]";
case 5: AdmRank = "{EB1F10}[MANAGEMENT]";
case 6: AdmRank = "{EB1F10}[FOUNDER]";
default: AdmRank = "[FOUNDER]";//Default means all the other
//unmentioned case. Since you have checked the player's level
//is larger than 1, this means he must be a founder
//(unless you have negative level).
}
}
format(string, 128, "%s{B3C924}%s [ID:%i] | Level: %d - %s\n", string, PlayerName2(i), i, AccInfo[i][Level], AdmRank);
//We are appending the string, so put %s before any new data is added,
//and that parameter actually refers to the string itself.
count++;
}
}
}
if (count == 0) ShowPlayerDialog(playerid, 500, DIALOG_STYLE_MSGBOX, "{AA3333}_________|- ONLINE ADMINS -|___________", "{AA3333}NO ADMINS ONLINE\n{33AA33} ____________", "Close", "");
else ShowPlayerDialog(playerid, 500, DIALOG_STYLE_MSGBOX, "{AA3333}___________|- ONLINE ADMINS -|__________", string, "Close", "");
//Don't show dialog in a loop, it won't show all the admins continuously.
//Show it after all the data are ready.
return 1;
}