"OR" on scripting
#1

I want this simple function work if StrategyArmy is 1 OR StrategyTerror is 1. If one is NOT on it will not work for the terror team OR army team. (I did those parts)

Is it right?

pawn Код:
if(weaponid == 31 && StrategyArmy == 1 || StrategyTerror == 1) // I THINK || WAS OR.
            SetPlayerHealth(playerid,health-41);
Ex: When StrategyArmy == 2 is on, it will only work for Terror.
Reply
#2

Yes || means "or".

Код:
&& 	and 	
|| 	or
More information here:

https://sampwiki.blast.hk/wiki/Control_Structures
Reply
#3

PHP код:
if(weaponid == 31 && (StrategyArmy == || StrategyTerror == 1)) // I THINK || WAS OR.
            
SetPlayerHealth(playerid,health-41); 
Reply
#4

Код:
 && == AND
|| == OR
! == Not
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)