31.12.2011, 13:42
My problem is that when I type /admins it shows all the players who are connected to the server. If a player is an admin for sure it shows his rank before his/her name, but if the player is a normal player it just show his name. I want it to show ONLY the admins names.
I tried this
Lol, but it didn't work.
pawn Code:
YCMD:admins(playerid, params[])
{
if(gPlayerLoggedIn[playerid] == 0) return 1;
SCM(playerid, COLOR_WHITE, "Administrators online:");
foreach(Player, i)
{
new level[128], string[128];
if(PlayerInfo[playerid][Admin] == 0 && PlayerInfo[i][Admin] > 1 /*&& AdminDuty[i] == 1*/)
{
switch(PlayerInfo[i][Admin])
{
case 2: level = ""adminlevel2"";
case 3: level = ""adminlevel3"";
case 4: level = ""adminlevel4"";
case 5: level = ""adminlevel5"";
}
format(string, sizeof(string), "%s %s", level, PlayerName(i));
SCM(playerid, COLOR_GREY, string);
}
if(PlayerInfo[playerid][Admin] > 0)
{
switch(PlayerInfo[i][Admin])
{
case 1: level = ""adminlevel1" (1)";
case 2: level = ""adminlevel2" (2)";
case 3: level = ""adminlevel3" (3)";
case 4: level = ""adminlevel4" (4)";
case 5: level = ""adminlevel5" (5)";
}
format(string, sizeof(string), "%s %s", level, PlayerName(i));
SCM(playerid, COLOR_GREY, string);
}
}
return 1;
}
pawn Code:
else if(PlayerInfo[playerid][Admin] == 0)
{
format(string,sizeof(string), "");
}