The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple conditions in one "if" statement
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#1
Multiple conditions in one "if" statement

So, basically I'm moving into DIFFERENT! scripting for me and I've struck a dead end. Without spoiling too much, I need to be able to check two conditions in one if statement. Is there any way to accomplish this?

Consider this script:
void Function(string &in asEntityName, int alState)
{
    if (GetLocalVarInt("Var01") == 1) && (GetLocalVarInt("Var02") == 1)
    {    
               //Do stuff
        return;
    }

    else if (GetLocalVarInt("Var01") == 1) && (GetLocalVarInt("Var02") == 2)
    {    
               //Do other stuff
        return;
    }
}

Apparently, the && doesn't work (I read that it does in C, probably just not in angelscript) or did I do it all wrong? Smile

Thanks in advance.
(This post was last modified: 07-21-2011, 11:35 AM by Roenlond.)
07-20-2011, 03:27 PM
Find


Messages In This Thread
Multiple conditions in one "if" statement - by Roenlond - 07-20-2011, 03:27 PM



Users browsing this thread: 1 Guest(s)