SA-MP Forums Archive
"OR" on scripting - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: "OR" on scripting (/showthread.php?tid=407248)



"OR" on scripting - Tamer - 13.01.2013

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.


Re: "OR" on scripting - ThePhenix - 13.01.2013

Yes || means "or".

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

https://sampwiki.blast.hk/wiki/Control_Structures


Re: "OR" on scripting - mineralo - 13.01.2013

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



Re: "OR" on scripting - Gamer_007 - 13.01.2013

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