/admins command - Minor issue
#1

Hello guys.
I made a /admins command, and it works just perfect when admins are online.
But when there are no admins online, its a little bit buggy. When no admins are online, its supposed to send this message: "No admins online at the moment" but it shows up multiple times.
Here is the command:
pawn Код:
COMMAND:admins(playerid, params[])
{
    SendClientMessage(playerid, COLOR_SYSTEMRED, "=========== Online Admins ===========");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(PlayerInfo[i][pAdminLevel] >= 1)
            {
                new name[MAX_PLAYER_NAME], string[21 + MAX_PLAYER_NAME];
                GetPlayerName(i,name,sizeof(name));
                format(string, sizeof(string), "(Level:%i) %s (ID:%i)", PlayerInfo[i][pAdminLevel], name, i);
                SendClientMessage(playerid, COLOR_SYSTEMRED, string);
            }
            else if(PlayerInfo[i][pAdminLevel] == 0) SendClientMessage(playerid, COLOR_SYSTEMRED, "No admins online at the moment");
        }
    }
    SendClientMessage(playerid, COLOR_SYSTEMRED, "===================================");
    return 1;
}
Hope you can help me. Thank you.
Reply


Messages In This Thread
/admins command - Minor issue - by sim_sima - 03.07.2011, 15:08
Re: /admins command - Minor issue - by Jay. - 03.07.2011, 15:10
Re: /admins command - Minor issue - by sim_sima - 03.07.2011, 15:11
Re: /admins command - Minor issue - by Jay. - 03.07.2011, 15:15
Re: /admins command - Minor issue - by WooTFTW - 03.07.2011, 15:37
Re: /admins command - Minor issue - by sim_sima - 03.07.2011, 19:09

Forum Jump:


Users browsing this thread: 1 Guest(s)