18.06.2015, 20:53
Hello everyone, so I have made an /fedit command and I have been trying to figure out how to allow both admin and faction leaders to access the same command but instead it puts both if statements together.
here is the code
the problem is if I am an admin and I am not a faction leader it gives me the message instead of the dialog.
here is the code
pawn Код:
CMD:fedit(playerid,params[]) //This is the family edit command
{
if(pInfo[playerid][USER_ADMIN] < 5)
{
SendClientMessage(playerid, -1, "You must be an admin or a faction leader to use this command!");
return 1;
}
if(pInfo[playerid][USER_FACTION] < 1 && pInfo[playerid][USER_FACTIONRANK] < 10)
{
SendClientMessage(playerid, -1, "You must be an admin or a faction leader to use this command!");
return 1;
}
if(pInfo[playerid][USER_FACTION] > 0 && pInfo[playerid][USER_FACTIONRANK] == 10)
{
ShowPlayerDialog(playerid, factionedit, DIALOG_STYLE_LIST, "Faction Edit Panel","Faction Name\nFaction Ranks\nFaction MOTD", "Select", "Close");
return 1;
}
if(pInfo[playerid][USER_ADMIN] == 5)
{
ShowPlayerDialog(playerid, factionedit, DIALOG_STYLE_LIST, "Faction Edit Panel","Faction Name\nFaction Ranks\nFaction MOTD", "Select", "Close");
return 1;
}
return 1;
}