/admins issue
#1

pawn Код:
CMD:admins ( playerid )
{
    new c = 0, str[128];
    if (PlayerInfo[playerid][LoggedIn] == 0) return SendClientMessage( playerid, -1, ""RED"ERROR: "GREY"You must be logged in!");
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
        if (IsPlayerConnected(i))
        {
            if (PlayerInfo[i][Admin] >= 1)
            {
                c++;
                format(str, sizeof(str), ""REDORANGE"There are "TELEPORTBLUE"%d "REDORANGE"staff member(s) online:\n{%06x}%s(%d)  "GREY"(Level: %d)\n", c, (GetPlayerColor(i) >>> 8), GetName(i), i, PlayerInfo[i][Admin]);
                ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, ""RED"Admins Online:", str, "OK", "");
            }
        }
    }
    return 1;
}
When there are 2 or more admins online, it shows only 1 in the list but the count is right (2 or more)..
Reply
#2

It should be something similar to this
pawn Код:
CMD:admins ( playerid )
{
    new c = 0, str[128];
    if (PlayerInfo[playerid][LoggedIn] == 0) return SendClientMessage( playerid, -1, ""RED"ERROR: "GREY"You must be logged in!");
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
        if (IsPlayerConnected(i))
        {
            if (PlayerInfo[i][Admin] >= 1)
            {
                c++;
                            if(c==1) {
                format(str, sizeof(str), ""REDORANGE"There are "TELEPORTBLUE"%d "REDORANGE"staff member(s) online:\n{%06x}%s(%d)  "GREY"(Level: %d)\n", c, (GetPlayerColor(i) >>> 8), GetName(i), i, PlayerInfo[i][Admin]);
                            }
                            if(c >=2)
                            {
                             format(str, sizeof(str), "%s \n{%06x}%s(%d)  "GREY"(Level: %d)", str, ...)
                            }
               
            }
        }
    }
         ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, ""RED"Admins Online:", str, "OK", "");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)