Do I need to put after both?
#1

If I do like this.
pawn Код:
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 && PlayerInfo[playerid][pDuty] == 1)
Will it check if the player is pMember 1 and pDuty = 1 too? Or do I need to pur the pDuty after pMember aswell? What I mean is, is this code the same as if I would put
pawn Код:
if(PlayerInfo[playerid][pMember] == 1 && PlayerInfo[playerid][pDuty] == 1 || PlayerInfo[playerid][pLeader] == 1 && PlayerInfo[playerid][pDuty] == 1)
Reply
#2

I'd use parentheses.
pawn Код:
if( ( PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 ) && PlayerInfo[playerid][pDuty] == 1 )
Quote:
Originally Posted by TataPhoton
Посмотреть сообщение
pawn Код:
if(PlayerInfo[playerid][pMember] == 1 && PlayerInfo[playerid][pDuty] == 1 && PlayerInfo[playerid][pLeader] == 1 && PlayerInfo[playerid][pDuty] == 1)
use This.
He wants either "Member and Duty" or "Leader and Duty". Your code will check if the player is "Member, Leader and Duty".
Reply
#3

So this one will only check if it's a member and nothing else, or if its a leader and duty?
pawn Код:
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 && PlayerInfo[playerid][pDuty] == 1)
Reply
#4

Use this:
pawn Код:
if(PlayerInfo[playerid][pMember] == 1 || (PlayerInfo[playerid][pLeader] == 1 && PlayerInfo[playerid][pDuty] == 1))
Reply
#5

Konstantinos method was correct. Most of the above check if they're leader and on duty or just a member.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)