SA-MP Forums Archive
/admins commands problems - 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: /admins commands problems (/showthread.php?tid=262599)



/admins commands problems - BizzyD - 18.06.2011

Hello, There is a problem with my /admins command.

When i do /admins, and there is more admins online. It spams them. Like it opens a new window.

Here is my /admins command

pawn Код:
if(strcmp(cmd, "/admins", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if(PlayerInfo[i][pAdmin] >= 1)
                    {
                        new adminstext[64];
                        SendClientMessage(playerid, COLOR_YELLOW5,"__________________________________________________________");
                        SendClientMessage(playerid, COLOR_LIGHTYELLOW5,"                   *** Administration Team:     ");
                        if(PlayerInfo[i][pAdmin] == 1339) { adminstext = "Owner"; }
                        else if(PlayerInfo[i][pAdmin] == 1338) { adminstext = "Co-Owner"; }
                        else if(PlayerInfo[i][pAdmin] == 1337) { adminstext = "Developer"; }
                        else if(PlayerInfo[i][pAdmin] == 6) { adminstext = "Lead Admin"; }
                        else if(PlayerInfo[i][pAdmin] == 5) { adminstext = "Level 5 Adminstratior"; }
                        else if(PlayerInfo[i][pAdmin] == 4) { adminstext = "Level 4 Administrator"; }
                        else if(PlayerInfo[i][pAdmin] == 3) { adminstext = "Level 3 Administrator"; }
                        else if(PlayerInfo[i][pAdmin] == 2) { adminstext = "Level 2 Administrator"; }
                        else if(PlayerInfo[i][pAdmin] == 1) { adminstext = "Level 1 Administrator"; }
                        SendClientMessage(playerid, COLOR_YELLOW5,"__________________________________________________________");
                        GetPlayerName(i, sendername, sizeof(sendername));
                        if(AdminDuty[i] == 0)
                        {
                            format(string, 256, "%s: %s (Off Duty)", sendername, adminstext);
                            SendClientMessage(playerid, COLOR_LIGHTYELLOW5, string);
                        }
                        else
                        {
                            format(string, 256, "%s: %s (on duty)", sendername, adminstext);
                            SendClientMessage(playerid, TEAM_VAGOS_COLOR, string);
                        }
                    }
                }
            }
        }
        return 1;
    }
This is what happends:

ImagesHack Pictures

Anyone know how to solve this?


Re: /admins commands problems - Kayaque - 18.06.2011

Put the lines like "_____________________________" and " ** Administrator team" etc OUTSIDE the loop.
Only use the loop for the lines where the player names and ID will show. Else you will get the whole menu for each admin online.


Re: /admins commands problems - BizzyD - 18.06.2011

Why didnt i think of that ^_^ Thanks