Player loop
#1

I have a loop in a command that loops through all the players online to see if they're an admin, but I want it to tell the command user if there are no admins online. How would I do this?
Reply
#2

wt u need can u explain /admins cmd?
Reply
#3

take a example of this code

pawn Code:
CMD:admins(playerid,params[])
{
    new count = 0;
    new string[128],name[50];
    new name1[MAX_PLAYER_NAME];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if (IsPlayerConnected(i))
        {
            GetPlayerName(i,name1,MAX_PLAYER_NAME);
            if(IsPlayerAdmin(i)) // change to your admins
            {
                {name = "{9900CC}Server Owner";}
                format(string, 128, "%s - %s", name1,name);
                SendClientMessage(playerid, COLOR_WHITE, string);
                count++;
            }
        }
    }
    if (count == 0)
    SendClientMessage(playerid,COLOR_GREY,"There are no Admins Online at the moment");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)