22.11.2012, 20:37
Well when I type /admins in game it also shows the players that have level 0 admin, any fix? heres the code;
Heres the ranks also;
pawn Code:
CMD:admins(playerid, params[])
{
new admins, szString[128], id;
SendClientMessage(playerid, 0x99FF00AA, ""NAME" online administrators.");
loop(i, MAX_PLAYERS) {
if (IsPlayerConnected(i)) {
if (GetAdminLevel(id) >= 1) {
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(i, PlayerName, sizeof(PlayerName));
admins++;
format(szString, sizeof(szString), "{EA8015}Admin %s(%d) (Level: %d) (%s)", PlayerName, id, GetAdminLevel(i), staffrank(i));
SendClientMessage(playerid, 0x99FF00AA, szString);
}
}
}
if (admins == 0) {
SendClientMessage(playerid, 0x99FF00AA, "{EA8015}[{C0C0C0}ERROR{EA8015}] No admins connected.");
}
else {
format(szString, sizeof(szString), "{EA8015}[{C0C0C0}INFO{EA8015}] There are currently %d Admins online.", admins);
SendClientMessage(playerid, 0x99FF00AA, szString);
}
return 1;
}
pawn Code:
stock staffrank(i)
{
new szString[128];
switch(GetAdminLevel(i))
{
case 0: szString = "Player";
case 1: szString = "Trial Admin";
case 2: szString = "Moderator";
case 3: szString = "Senior Moderator";
case 4: szString = "Lead Admin";
case 5: szString = "Head Admin";
case 6: szString = "Owner";
}
return szString;
}