/admins dialog
#2

Use foreach because it's faster and it loops through the connected players only.

pawn Code:
CMD:admins(playerid, params[])
{
    new count, string[256], AdmRank[32] = "N/A", nameee[21];
    foreach(new i : Player)
    {
        if (PlayerInfo[i][Level] < 1) continue;
        count++;
        GetPlayerName(i, nameee, sizeof (nameee));
        if (!strcmp(nameee, "[COD]ZORN", true) || !strcmp(nameee, "Colonel", true)) AdmRank = "[Server Mapper]";
        else if (!strcmp(nameee, "[COD]SelnaGo", true) || !strcmp(nameee, "Jimmy", true)) AdmRank = "[Server Owner]";
        else if (!strcmp(nameee, "[COD]SNAKE",true) | !strcmp(nameee, "SourceVG", true)) AdmRank ="[Scripter][Server Owner]";
        format(string, sizeof (string), "%sADMIN: [%d]%s Level: %d %s\n", string, i, PlayerName2(i), PlayerInfo[i][Level], AdmRank);
        // Does "PlayerName2" function return different name? If not, change to "nameee" since you got the name already.
    }
    if (!count) SendClientMessage(playerid, COLOR_PINK,"No Admins Online");
    else ShowPlayerDialog(playerid, 678, DIALOG_STYLE_MSGBOX, "Current Online Admins:", string, "Close", "");
    return 1;
}
Reply


Messages In This Thread
/admins dialog - by MORJAN1122 - 22.04.2014, 15:16
Re: /admins dialog - by Konstantinos - 22.04.2014, 15:27

Forum Jump:


Users browsing this thread: 1 Guest(s)