Jump to content
Sign in to follow this  
SkaceKachna

If does NOT work

Recommended Posts

Hello, i have problem with if, switch etc... in my sqs script. They do NOT work! Example:

_letakaluz = 10;
if (_letakaluz == 5) then
{
...action1...
};
if (_letakaluz == 10) then
{
...action2...
};

But in-game, action1 perform too! The same with switch...

(sorry for bad english)

Share this post


Link to post
Share on other sites

Put it all on one line, do this:

_letakaluz = 10;

if (_letakaluz == 5) then {...action1...};

if (_letakaluz == 10) then {...action2...};

Don't ask why it has to be on one line. Just the language, I guess. Anyway... that worked for me, just tested it.

Share this post


Link to post
Share on other sites

execute it with execVM or spawn command and you dont need to put it in one line.

Share this post


Link to post
Share on other sites

You're using SQF's IF statement apparently in an SQS script?

JDog's suggestion should work, since ; is comment in SQS instead of 'end of statement' in SQF.

Read about the syntax of SQF and SQS and use and learn SQF. :)

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  

×