07.06.2014, 23:40
need admin command like /admins to see all admin's
#define DIALOG_ADMINS 1337
CMD:admins(playerid,params[])
{
#pragma unused params
new count = 0;
new string[128];
new fstring[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if(AdminLvl[i] > 0)
{
format(fstring, sizeof(fstring), "{FFFFFF}Admin Level: {00bbff}%d{FFFFFF} - %s(%i)\n",AdminLvl[i], PlayerName(i), i);
strcat(string, fstring);
count++;
}
}
}
if (count == 0) return ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, "{00bbff}Online Admins", "{FFFFFF}No administrators online.", "Okay","");
else
{
format(fstring, sizeof(fstring), "\r\n{00FF00}Total: {FFFFFF}%d", count);
strcat(string, fstring);
ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, "{00bbff}Online Admins", string, "Okay", "");
}
return 1;
}
stock PlayerName(playerid)
{
new name[255];
GetPlayerName(playerid, name, 255);
return name;
}