PDA

View Full Version : Command permissions. +REP.


canip0000
11/07/2016, 06:00 PM
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? :)

DarkSkull
11/07/2016, 06:02 PM
You are checking if the the player is Admin and Trial Admin. You should check if the player is admin or Trial admin instead.

if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][trialAdmin]) {

EDIT: Indeed I was. 8)

Freaksken
11/07/2016, 06:02 PM
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 :p.

canip0000
11/07/2016, 06:05 PM
Thanks it worked.