Results 1 to 5 of 5

Thread: if/else Statements in SQS Files

  1. #1

    if/else Statements in SQS Files

    Hi, I'm working on my own private version of Warfare right now, and I've been trying to modify kill bounties so that East gets four times the bounty. All I've done is add "if" and "else" statements around the original line that sets the value of the bounty, and added the *4 modifier:

    if (_killerSide == "east") then {
    _bounty = (unitBounties Select _index) * BOUNTYMODIFIER * 4;
    } else { _bounty = (unitBounties Select _index) * BOUNTYMODIFIER;
    };

    However, in-game, it always gives me two errors - "Generic error in statement" for the if statement and a syntax error for the else statement.

    The _killerSide variable looks strange because it's being set to "east" instead of East, but the variable is initialized as a string, so I'm sure this is correct.

    Is there something I'm doing wrong with the if/else statements or is it something else?

    Any help would be appreciated.

  2. #2
    In sqs you can not spread an if/else over multiple lines, you have to put all into one line
    ECS Team - Poweruser

  3. #3
    Master Gunnery Sergeant
    Join Date
    Dec 13 2003
    Location
    Melbourne, Australia
    Posts
    1,362
    WHY SQS?!!!

    Oh the horror

    Australian Armed Forces - Dedicated Tactical Coop Squad for ArmA2

  4. #4
    Quote Originally Posted by Rommel View Post
    WHY SQS?!!!

    Oh the horror
    Why not? It works and is simple to write. When actually playing a mission you won't have any idea which suffix the scripts have.

  5. #5
    Quote Originally Posted by dengibtsschon View Post
    In sqs you can not spread an if/else over multiple lines, you have to put all into one line
    Ah ok, that did the trick. Thanks!

Posting Permissions

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