Command permissions. +REP.
#1

pawn Код:
CMD:adminhelp(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][trialAdmin]) {
    SendClientMessage(playerid, COLOR_LIGHTRED, "[ Trial Admins ]: /asay, /spec(off) [id], /kick, /jail, /warn, /hphack, /mute.");
    SendClientMessage(playerid, COLOR_LIGHTRED, "[ Game Admins 1]: /ban, /unban, /ip, /disarm, /check, /setint, /setvw, /goto.");
    SendClientMessage(playerid, COLOR_LIGHTRED, "[ Game Admins 1]: /sendto, /respawncars.");
    SendClientMessage(playerid, COLOR_LIGHTRED, "[ Game Admin 2]: /settime, /setweather, /refund(Only for refunder team).");
    SendClientMessage(playerid, COLOR_LIGHTRED, "[ Game Admin 3]: /getall, /armourallnear, /healthallnear, /weaponallnear, /event(Event team only).");
    SendClientMessage(playerid, COLOR_LIGHTRED, "[ Game Admin 4(IG Lead)]: /makeleader, /removeleader, /addv(For dealership).");
    SendClientMessage(playerid, COLOR_LIGHTRED, "[ Game Admin 5(Management)]: /adddealership, /removedealership, /makegdlead, /makeddlead, /setcash.");
    SendClientMessage(playerid, COLOR_LIGHTRED, "[ Game Admin 5(Management)]: /setweaponskill, /makedonator, /createhouse.");
    }
    else
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "[ ! ] You do not have access to this command. (Trial Admins+)");
    }
    return 1;
}
Hello. IG I want to make this command able for Game Admins level+1 & Trial Admins. But it sorta doesn't want to let me use the command if I'm only having the trial admin rank? Only if I have the game admin rank. Can anybody help me out?
Reply
#2

You are checking if the the player is Admin and Trial Admin. You should check if the player is admin or Trial admin instead.

PHP код:
if(PlayerInfo[playerid][pAdmin] >= || PlayerInfo[playerid][trialAdmin]) { 
EDIT: Indeed I was.
Reply
#3

Quote:
Originally Posted by canip0000
Посмотреть сообщение
pawn Код:
CMD:adminhelp(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][trialAdmin]) {
    SendClientMessage(playerid, COLOR_LIGHTRED, "[ Trial Admins ]: /asay, /spec(off) [id], /kick, /jail, /warn, /hphack, /mute.");
    SendClientMessage(playerid, COLOR_LIGHTRED, "[ Game Admins 1]: /ban, /unban, /ip, /disarm, /check, /setint, /setvw, /goto.");
    SendClientMessage(playerid, COLOR_LIGHTRED, "[ Game Admins 1]: /sendto, /respawncars.");
    SendClientMessage(playerid, COLOR_LIGHTRED, "[ Game Admin 2]: /settime, /setweather, /refund(Only for refunder team).");
    SendClientMessage(playerid, COLOR_LIGHTRED, "[ Game Admin 3]: /getall, /armourallnear, /healthallnear, /weaponallnear, /event(Event team only).");
    SendClientMessage(playerid, COLOR_LIGHTRED, "[ Game Admin 4(IG Lead)]: /makeleader, /removeleader, /addv(For dealership).");
    SendClientMessage(playerid, COLOR_LIGHTRED, "[ Game Admin 5(Management)]: /adddealership, /removedealership, /makegdlead, /makeddlead, /setcash.");
    SendClientMessage(playerid, COLOR_LIGHTRED, "[ Game Admin 5(Management)]: /setweaponskill, /makedonator, /createhouse.");
    }
    else
    {
        SendClientMessage(playerid, COLOR_LIGHTRED, "[ ! ] You do not have access to this command. (Trial Admins+)");
    }
    return 1;
}
Hello. IG I want to make this command able for Game Admins level+1 & Trial Admins. But it sorta doesn't want to let me use the command if I'm only having the trial admin rank? Only if I have the game admin rank. Can anybody help me out?
You should use OR
Код:
||
instead of AND
Код:
&&
.

EDIT:
DarkSkull was faster .
Reply
#4

Thanks it worked.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)