07.01.2015, 16:06
pawn Код:
CMD:admins(playerid, params[])
{
new count_admins = 0, string[500], fstring[100];
foreach(new i: Player)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][AdminLevel] >= 1)
{
switch(PlayerInfo[i][AdminLevel])
{
case 1: rank = "level 1";
case 2: rank = "level 2";
case 3: rank = "level 3";
case 4: rank = "level 4";
case 5: rank = "level 5";
}
count_admins++;
}
if(IsPlayerAdmin(i))
{
count_admins++;
rank = "rcon";
}
strdel(fstring, 0, 100);
format(fstring, sizeof(fstring), "{FFFFFF}%s(ID:%d) {44FF00}[Rank: %s]\n", PlayerName(i), i, rank);
strcat(string, fstring);
if(count_admins != 0)
{
format(fstring, sizeof(fstring), "\r\n\n\n\n\n{FFFFFF}Total Admins: %d", count);
strcat(string, fstring, 556);
ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, "{44FF00}Online {FFFFFF}Admins", string, "Okay", "");
}
else if(count_admins == 0)
{
ShowPlayerDialog(playerid, DIALOG_Admins, DIALOG_STYLE_MSGBOX, "{44FF00}Online {FFFFFF}Admins", "{FF0000}There is no current admins online!", "Okay", "");
}
}
}
return true;
}