Page 1 of 1

Check two variables?

PostPosted: Sat Jul 30, 2011 3:51 am
by ThaKid244
Hey all,

I was wondering if it is possible to check two variables as in the example:

if (Wall == 2)
{
if (InvGas == 0)
{
DestroyActor("GasCan");
}
}

Thank you.

Re: Check two variables?

PostPosted: Sat Jul 30, 2011 4:30 am
by DST
if (Wall == 2 && InvGas ==0){
}

&& = and this is true

|| = or this is true

you can combine them

if(Wall == 2 && InvGas ==0 || Wall == 100000 && InvGas == 2){

will occur if everything before the || is true OR if everything after the || is true.

Re: Check two variables?

PostPosted: Sat Jul 30, 2011 11:39 am
by ThaKid244
Okay thank you DST