SA-MP Forums Archive
help me with this admin script please - 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)
+--- Thread: help me with this admin script please (/showthread.php?tid=394700)



help me with this admin script please - Hugoca - 23.11.2012

pawn Код:
if (strcmp(cmdtext, "/admins", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            SendClientMessage(playerid, COLOR_GREEN, "Admins Online:");
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pHide] == 0)
                    {
                        new admin[20];
                        if(PlayerInfo[playerid][pAdmin] == 1) { admin = "Test Admin"; }
                        else if(PlayerInfo[playerid][pAdmin] == 2) { admin = "Moderator"; }
                        else if(PlayerInfo[playerid][pAdmin] == 3) { admin = "Administrator"; }
                        else if(PlayerInfo[playerid][pAdmin] == 4) { admin = "Owner"; }
                        new sendername[MAX_PLAYER_NAME];
                        GetPlayerName(i, sendername, sizeof(sendername));
                        if(PlayerInfo[i][aDuty] == 0)
                        {
                            format(string, 256, "%s:{FFFF00}%s(ID:%d)   {FF0000}Off-Duty",admin,  sendername, i);
                            SendClientMessage(playerid, COLOR_RED, string);
                        }
                        else if(PlayerInfo[i][aDuty] == 1)
                        {
                            format(string, 256, "%s:{FFFF00}%s(ID:%d)   {00FF00}On-Duty",admin, sendername, i);
                            SendClientMessage(playerid, COLOR_GREEN, string);
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_YELLOW, "No admins online!");
                        }
                    }
                }
            }
            SendClientMessage(playerid, COLOR_GREEN, "______________");
        }
        return 1;
    }
when i use command all admins have the first listed admin rank?


Re: help me with this admin script please - CmZxC - 23.11.2012

Quote:
Originally Posted by Hugoca
Посмотреть сообщение
pawn Код:
I HAVE NO IDEA WHAT IM DOING
when i use command all admins have the first listed admin rank?
Yes, what is the problem then?


Re: help me with this admin script please - Hugoca - 23.11.2012

Hm..The problem is this:
Owner:[KOD]MrTinder Off-Duty
Owner:wManiak Off-Duty
but the wmaniak is 2 level admin ?


Re: help me with this admin script please - YoYo123 - 23.11.2012

pawn Код:
if(PlayerInfo[playerid][pAdmin] == 1) { admin = "Test Admin"; }
                        else if(PlayerInfo[playerid][pAdmin] == 2) { admin = "Moderator"; }
                        else if(PlayerInfo[playerid][pAdmin] == 3) { admin = "Administrator"; }
                        else if(PlayerInfo[playerid][pAdmin] == 4) { admin = "Owner"; }
it should be 'i', not 'playerid'.