Results 1 to 5 of 5

Thread: If does NOT work

  1. #1

    Angry If does NOT work

    Hello, i have problem with if, switch etc... in my sqs script. They do NOT work! Example:
    Code:
    _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)

  2. #2
    Put it all on one line, do this:

    Code:
    _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.

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

  4. #4
    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.

  5. #5
    Private First Class MEN-X's Avatar
    Join Date
    Jun 21 2009
    Posts
    16
    Author of the Thread
    Thank's very much!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •