Jump to content
Sign in to follow this  
Norbak

problem with a condition IF

Recommended Posts

I have a problem with this:

A script "Symp.sqf" and called from an action bar.

I want when variables "Symp1" and "Symp2" are activated then...

But it doesn't work. That easy thing and fail!. I'm confused. Anyone know?

If (Symp1 && Symp2) then {

SoldierDDBar = SoldierDD addaction [("<t color=""#3838ff"">" + ("Gang Bang!")+"</t>"), "scripts\symp3.sqf", [], 0, false, true, "", ""]

};

Share this post


Link to post
Share on other sites

Your addaction works, which means your Symp1 && Symp2 don't.

"if (...) then" is a boolean test - true/false.

Whatever the condition result is must return "true" for the code to run.

"&&" is a Boolean test - true/false.

Values on both sides must return "true" for the condition to return true so the code will run.

Your attempt fails because "Symp1" and "Symp2" are defined as something other than True or False. eh... scratch that, won't work on "false" (doh!)

example:

Symp1 = true;
Symp2 = false;

//  Code will not run since both are not true.

if (!alive _badDude) then {Symp2 = true};

// If _badDude is dead (!alive returns true) the code will run, because both Symp1 and Symp2 are true.

Edited by OpusFmSPol

Share this post


Link to post
Share on other sites

Then i got some wrong at the true/false on the variables Symp1 and symp2. is that correct?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×