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.");
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.");
Try this.
PHP код:
|
&& and if (Left && Right)
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;
}
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])
return SendClientMessage(playerid, COLOR_ADM, "ACCESS DENIED:{FFFFFF} Your rank doesn't have permission to do this.");
if(PlayerData[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_ADM, "ACCESS DENIED:{FFFFFF} Your rank doesn't have permission to do this. ADMIN");
ShowYourFactionMenu(playerid);
return 1;
}
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. |
Wouldn't that require both structures to be correct in order to work?
Код:
&& and if (Left && Right) |