SA-MP Forums Archive
how to make a cmd for admins - 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: how to make a cmd for admins (/showthread.php?tid=502595)



how to make a cmd for admins - Mckarlis - 24.03.2014

i wanted to make a cmd for admins so if a lvl1 admin did something like /acmds he would only get to see the lvl 1 cmds and than if a lvl 2 does /acmds he would see lvl 1 cmds and lvl 2 cmds so i need this up to a lvl 7

I will +REP the helper


Re: how to make a cmd for admins - TLN - 24.03.2014

pawn Код:
CMD:test(playerid, params[]) // Change 'test' to your command name
{
    if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid))
    {
    // code here
    }
    return 1;
}



Re: how to make a cmd for admins - Mckarlis - 24.03.2014

Quote:
Originally Posted by TLN
Посмотреть сообщение
pawn Код:
CMD:test(playerid, params[]) // Change 'test' to your command name
{
    if(PlayerInfo[playerid][pAdmin] >= 1 || IsPlayerAdmin(playerid))
    {
    // code here
    }
    return 1;
}
But can you do it for all the admin lvls so if they use the same cmd


Re: how to make a cmd for admins - TLN - 24.03.2014

All admins with level 1 or higher will be able to use it.


Re: how to make a cmd for admins - iShawn - 24.03.2014

if(PlayerInfo[playerid][Admin] < 1) return SendClientMessage(playerid, RED, "You are not an administrator");
if(PlayerInfo[playerid][Admin] < 2)
{
SendClientMessage(playerid, 0xFFFFFFAA, "You commands here");
}
else if(PlayerInfo[playerid][Admin] < 3
*/and bla bla bla*/
or
if(PlayerInfo[playerid][Admin] > 1)
{
SendClientMessage(playerid, 0xFFFFFFAA, "Commands here");
}
else if(PlayerInfo[playerid][Admin] > 1)
/*bla bla bla*/


Re: how to make a cmd for admins - Mckarlis - 24.03.2014

Quote:
Originally Posted by iShawn
Посмотреть сообщение
if(PlayerInfo[playerid][Admin] < 1) return SendClientMessage(playerid, RED, "You are not an administrator");
if(PlayerInfo[playerid][Admin] < 2)
{
SendClientMessage(playerid, 0xFFFFFFAA, "You commands here");
}
else if(PlayerInfo[playerid][Admin] < 3
*/and bla bla bla*/
or
if(PlayerInfo[playerid][Admin] > 1)
{
SendClientMessage(playerid, 0xFFFFFFAA, "Commands here");
}
else if(PlayerInfo[playerid][Admin] > 1)
/*bla bla bla*/
What is this im confused


Re: how to make a cmd for admins - kloning1 - 25.03.2014

pawn Код:
CMD:acmds(playerid, params[]) {
    if (PlayerInfo[playerid][AdminLevel] == 1) {
        // Do Something here
    }
    if (PlayerInfo[playerid][AdminLevel] == 2) {
        // Do Something here
    }
    if (PlayerInfo[playerid][AdminLevel] == 3) {
        // Do Something here
    }
    if (PlayerInfo[playerid][AdminLevel] == 4) {
        // Do Something here
    }
    if (PlayerInfo[playerid][AdminLevel] == 5) {
        // Do Something here
    }
    if (PlayerInfo[playerid][AdminLevel] == 6) {
        // Do Something here
    }
    if (PlayerInfo[playerid][AdminLevel] == 7) {
        // Do Something here
    }

    if (PlayerInfo[playerid][AdminLevel] == 0) {
    return SendClientMessage(playerid, COLOR_RED, "ERROR: You not a Admin.");
    }
 return 1;
 }
if helping you +Rep for me sir
you must add command from the previous level
ex :

pawn Код:
CMD:acmds(playerid, params[]) {
    if (PlayerInfo[playerid][AdminLevel] == 1) {
        SendClientMessage(playerid, COLOR_RED, "Player : kill");
    }
    if (PlayerInfo[playerid][AdminLevel] == 2) {
        SendClientMessage(playerid, COLOR_RED, "Player : kill");
        SendClientMessage(playerid, COLOR_RED, "Vehicle : aCar");
    }
    if (PlayerInfo[playerid][AdminLevel] == 3) {
        SendClientMessage(playerid, COLOR_RED, "Player : kill");
        SendClientMessage(playerid, COLOR_RED, "Vehicle : aCar");
        SendClientMessage(playerid, COLOR_RED, "Other : admins");
    }
    if (PlayerInfo[playerid][AdminLevel] == 4) {
        // Do Something here
    }
    if (PlayerInfo[playerid][AdminLevel] == 5) {
        // Do Something here
    }
    if (PlayerInfo[playerid][AdminLevel] == 6) {
        // Do Something here
    }
    if (PlayerInfo[playerid][AdminLevel] == 7) {
        // Do Something here
    }

    if (PlayerInfo[playerid][AdminLevel] == 0) {
    return SendClientMessage(playerid, COLOR_RED, "ERROR: You not a Admin.");
    }
 return 1;
 }



Re: how to make a cmd for admins - kinggta - 25.03.2014

tnx i use you Tutorial