SA-MP Forums Archive
Command permissions. +REP. - 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: Command permissions. +REP. (/showthread.php?tid=611857)



Command permissions. +REP. - canip0000 - 11.07.2016

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?


Re: Command permissions. +REP. - DarkSkull - 11.07.2016

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.


Re: Command permissions. +REP. - Freaksken - 11.07.2016

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 .


Re: Command permissions. +REP. - canip0000 - 11.07.2016

Thanks it worked.