[SOLVED] Help with /admins cmd
#5

Try this
pawn Код:
if (strcmp(cmd, "/admins", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        new count = 0;
        SendClientMessage(playerid, COLOR_CYAN, "Present Administrators:");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] <= 1338 || PlayerInfo[i][pTester] >= 1 && PlayerInfo[i][pTester] <= 3)
                {
                    new admtext[64];
                    if(AppearInAdminList[i] == 0)
                    {
                        if(PlayerInfo[i][pAdmin] == 1338) { admtext = "Owner"; }
                        else if(PlayerInfo[i][pAdmin] == 1337) { admtext = "Scripter"; }
                        else if(PlayerInfo[i][pAdmin] == 6) { admtext = "Developer"; }
                        else if(PlayerInfo[i][pAdmin] == 5) { admtext = "Manager"; }
                        else if(PlayerInfo[i][pAdmin] == 4) { admtext = "Administrator"; }
                        else if(PlayerInfo[i][pAdmin] == 3) { admtext = "Administrator"; }
                        else if(PlayerInfo[i][pAdmin] == 2) { admtext = "Moderator"; }
                        else if(PlayerInfo[i][pAdmin] == 1) { admtext = "Moderator"; }
                        else if(PlayerInfo[i][pTester] == 3) { admtext = "Lead Tester"; }
                        else if(PlayerInfo[i][pTester] == 2) { admtext = "Tester"; }
                        else if(PlayerInfo[i][pTester] == 1) { admtext = "Trial Tester"; }
                        else { admtext = "Unknown Rank"; }
                    }
                   
                    GetPlayerName(i, sendername, sizeof(sendername));
                    if(PlayerInfo[i][pAdminDuty] == 0)
                    {
                        format(string, sizeof(string), "%s - %s", admtext, sendername);
                        SendClientMessage(playerid, COLOR_CYAN, string);
                        count++;
                    }
                    else if(PlayerInfo[i][pAdminDuty] == 1)
                    {
                        format(string, sizeof(string), "%s - %s (On Duty)", admtext, sendername);
                        SendClientMessage(playerid, COLOR_CYAN, string);
                        count++;
                    }
                }
            }
        }
        if(count == 0)
        {
            format(string, sizeof(string), "No Admins present");
            SendClientMessage(playerid, COLOR_CYAN, string);
            return 1;
        }
    }
    return 1;
}
Reply


Messages In This Thread
[SOLVED] Help with /admins cmd - by Mokerr - 29.04.2010, 23:07
Re: Help with /admins cmd - by cessil - 30.04.2010, 02:41
Re: Help with /admins cmd - by Mokerr - 30.04.2010, 08:46
Re: Help with /admins cmd - by cessil - 30.04.2010, 09:03
Re: Help with /admins cmd - by dice7 - 30.04.2010, 09:08
[SOLVED] Help with /admins cmd - by Mokerr - 30.04.2010, 09:26

Forum Jump:


Users browsing this thread: 3 Guest(s)