SA-MP Forums Archive
[SOLVED] Help with /admins cmd - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [SOLVED] Help with /admins cmd (/showthread.php?tid=144955)



[SOLVED] Help with /admins cmd - Mokerr - 29.04.2010

- solved


Re: Help with /admins cmd - cessil - 30.04.2010

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


Re: Help with /admins cmd - Mokerr - 30.04.2010

So the Solution is?


Re: Help with /admins cmd - cessil - 30.04.2010

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.


Re: Help with /admins cmd - dice7 - 30.04.2010

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;
}



[SOLVED] Help with /admins cmd - Mokerr - 30.04.2010

- solved