SA-MP Forums Archive
/admin command help - 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: /admin command help (/showthread.php?tid=397247)



/admin command help - Threshold - 04.12.2012

Guys,
Im having a problem with my /admins command. If i am Level 1 .. Then i type /admins. My name shows BUT if i am level 3. My name doesnt show up. Just the header does which is, -| ADMINS |-. Somebody please kindly help me with this problem.

pawn Код:
COMMAND:admins(playerid,params[])
{
    if(IsPlayerConnected(playerid))
    {
        SendClientMessage(playerid, COLOR_RED, " ");
        SendClientMessage(playerid, COLOR_RED, "-| ADMINS |-");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(PlayerInfo[i][pAdmin] < 1 && PlayerInfo[i][pAdmin] < 3)
                {
                new admtext[64];
                new sendername[MAX_PLAYER_NAME];
                new string[256];
                if(PlayerInfo[i][pAdmin] == 1) { admtext = "Level-1 Trial Admin"; }
                else if(PlayerInfo[i][pAdmin] == 2) { admtext = "Level-2 Administrator"; }
                else if(PlayerInfo[i][pAdmin] == 3) { admtext = "Level-3 Master Administrator"; }
                GetPlayerName(i, sendername, sizeof(sendername));
                format(string, 256, "%s ( %s )", sendername, admtext);
                SendClientMessage(playerid, COLOR_RED, string);
                }
            }
        }
    }
    return 1;
}



Re: /admin command help - [HK]Ryder[AN] - 04.12.2012

Use this
pawn Код:
COMMAND:admins(playerid,params[])
{
    if(IsPlayerConnected(playerid))
    {
        SendClientMessage(playerid, COLOR_RED, " ");
        SendClientMessage(playerid, COLOR_RED, "-| ADMINS |-");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(PlayerInfo[i][pAdmin] > 0 && PlayerInfo[i][pAdmin] < 3)
                {
                new admtext[64];
                new sendername[MAX_PLAYER_NAME];
                new string[256];
                if(PlayerInfo[i][pAdmin] == 1) { admtext = "Level-1 Trial Admin"; }
                else if(PlayerInfo[i][pAdmin] == 2) { admtext = "Level-2 Administrator"; }
                else if(PlayerInfo[i][pAdmin] == 3) { admtext = "Level-3 Master Administrator"; }
                GetPlayerName(i, sendername, sizeof(sendername));
                format(string, 256, "%s ( %s )", sendername, admtext);
                SendClientMessage(playerid, COLOR_RED, string);
                }
            }
        }
    }
    return 1;
}



Re: /admin command help - Threshold - 04.12.2012

Doesnt work. When im level 3 just shows -| ADMINS |- PLus i dont see the difference in the script ..


Re: /admin command help - YoYo123 - 04.12.2012

Sorry double post.


Re: /admin command help - YoYo123 - 04.12.2012

instead of this in the if statement:
pawn Код:
PlayerInfo[i][pAdmin] > 0 && PlayerInfo[i][pAdmin] < 3
use this:
pawn Код:
PlayerInfo[i][pAdmin] > 0 && PlayerInfo[i][pAdmin] <= 3



Re: /admin command help - Threshold - 04.12.2012

Thanks! +REP Yoyo