08.01.2012, 15:39
If it is possible, how can i make this from lowest admin level to highest
pawn Код:
CMD:admins(playerid, params[])
{
new OnAdmins = 0;
SCM(playerid,-1,"-----------------------------------Admins Online-----------------------------------");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerData[i][AdminLevel] != 0 && hide[i] == 0)
{
GetPlayerName(i,Nam,MAX_PLAYER_NAME);
if(PlayerData[i][AdminLevel] == 1)
{
format(str, sizeof(str), "%s level 1 (Server Moderator)",Nam);
SCM(playerid,COLOR_YELLOW,str);
}
if(PlayerData[i][AdminLevel] == 2)
{
format(str, sizeof(str), "%s level 2 (Global Moderator)",Nam);
SCM(playerid,COLOR_BLUE,str);
}
if(PlayerData[i][AdminLevel] == 3)
{
format(str, sizeof(str), "%s level 3 (Administrator)",Nam);
SCM(playerid,red,str);
}
if(PlayerData[i][AdminLevel] == 4)
{
format(str, sizeof(str), "%s level 4 (Lead Admin)",Nam);
SCM(playerid,COLOR_LIMEGREEN,str);
}
if(PlayerData[i][AdminLevel] == 5)
{
format(str, sizeof(str), "%s level 4 (Head Admin)",Nam);
SCM(playerid,COLOR_LIMEGREEN,str);
}
OnAdmins ++;
}
}
}
if(OnAdmins == 0)
{
SCM(playerid,0xFF0000FF,"No Admins are connected in the server.");
}
if(OnAdmins == 1)
{
format(str,sizeof(str),"There is only %d admin connected right now!",OnAdmins);
SCM(playerid,orange,str);
}
if(OnAdmins > 1)
{
format(str,sizeof(str),"There are %d admins connected right now!",OnAdmins);
SCM(playerid,orange,str);
}
return 1;
}