Posts: 233
Threads: 82
Joined: Jan 2011
pawn Код:
if(PlayerData[playerid][pFactionRank] > FactionData[PlayerData[playerid][pFaction]][factionEditrank] || PlayerData[playerid][pAdmin] < 5)
return SendClientMessage(playerid, COLOR_ADM, "ACCESS DENIED:{FFFFFF} Your rank doesn't have permission to do this.");
For some reason, even as above level 5 admin it doesn't let me do the command? I'm obviously failing to see the obvious, can someone help please.
Posts: 233
Threads: 82
Joined: Jan 2011
Quote:
Originally Posted by GTLS
Try this.
PHP код:
if((PlayerData[playerid][pFactionRank] > FactionData[PlayerData[playerid][pFaction]][factionEditrank]) && PlayerData[playerid][pAdmin] < 5)
return SendClientMessage(playerid, COLOR_ADM, "ACCESS DENIED:{FFFFFF} Your rank doesn't have permission to do this.");
|
Wouldn't that require both structures to be correct in order to work?
Код:
&& and if (Left && Right)
Posts: 180
Threads: 22
Joined: Dec 2015
Reputation:
0
If this is a command show us the full code.
Posts: 233
Threads: 31
Joined: Feb 2018
Reputation:
0
Try PlayerData[playerid] [pAdmin] <= 5
Posts: 233
Threads: 82
Joined: Jan 2011
Quote:
Originally Posted by Exhibit
If this is a command show us the full code.
|
pawn Код:
CMD:configfaction(playerid, params[])
{
if(!PlayerData[playerid][pFaction])
return SendClientMessage(playerid, COLOR_ADM, "ERROR: You aren't in a faction.");
if(PlayerData[playerid][pFactionRank] > FactionData[PlayerData[playerid][pFaction]][factionEditrank] || PlayerData[playerid][pAdmin] < 5)
return SendClientMessage(playerid, COLOR_ADM, "ACCESS DENIED:{FFFFFF} Your rank doesn't have permission to do this.");
ShowYourFactionMenu(playerid);
return 1;
}
Posts: 233
Threads: 82
Joined: Jan 2011
Quote:
Originally Posted by jasperschellekens
Are you sure that this:
PlayerData[playerid][pAdmin]
Holds the correct value?
Try printing it to be sure, your code looks ok. It should work
Im pretty sure the topic starter knows this method. He clearly doesn't want to do it this way hence he is using || (means or in an if-statement).
The way you showed him is repeating code and his method using ||/or should work.
|
It does hold the correct value. I'm not sure why it isn't working - trying to figure ways around it.