[SOLVED] Help with /admins cmd
#1

- solved
Reply
#2

your brackets are a lil muddled up, at the moment

Код:
   					if(count == 0)
						{
							format(string, sizeof(string), "No Admins present");
							SendClientMessage(playerid, COLOR_CYAN, string);
						}
the code will only go to that part if there is an admin online in which case count will go up making it never get to that part
Reply
#3

So the Solution is?
Reply
#4

I've just told you how to fix it, if you don't know how to script go post in the request thread, I'm not your scripter.
Reply
#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
#6

- solved
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)