issue with command that lists admins available
#1

Код:
CMD:admins(playerid)
{
    new flag = 0, str[128];
    
    SendClientMessage(playerid, COLOR_AQUA, "Administrators online:");
    
    foreach(new i:Player)
    {
        if(PlayerInfo[playerid][pAdmin] > 0)
        {
            flag = 1;
             
            if(PlayerInfo[playerid][pAdmin] == KEY_ACTION)
                return format(str, sizeof(str), "{00ff6b}[Paused]{FFFFFF} %s: %s", ReturnAdminLevel(i), ReturnName(i));
    
            if(PlayerInfo[playerid][pAdminDuty] == 1)
            {
                format(str, sizeof(str), "{00ff6b}[Available]{FFFFFF} %s: %s", ReturnAdminLevel(i), ReturnName(i));
            }
            else
                format(str, sizeof(str), "{FF0000}[Unavailable]{FFFFFF} %s: %s", ReturnAdminLevel(i), ReturnName(i));
            return SendClientMessage(i, -1, str);
        }
    }
    if(flag == 0)
        return SendClientMessage(playerid, -1, "There are no admins available currently.");
    
    return 1;
}
basically, this is ment to show a list of admins online with the following tags. [Available] when an admin is on duty, [Unavailable] if they are not on duty, and [Paused] if they are paused, regardless of if they are available or not.

However, it's not working as intended, and I can't find the issue. Maybe someone can help? Much appreciated.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)