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
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#4
RE: Multiple conditions in one "if" statement

Yes, && is the proper operator.

Also, there are lots of ways to use if statements, especially with multiple and dynamic conditions like this case.

You can do

if(GetLocalVarInt("Var01") == 1) {
    switch(GetLocalVarInt("Var02")) {
        case 1:
            //Cool stuff
        break;
        case 2:
            //Other cool stuff
        break;
    }}

There are at least 3 other neat ways to do that too, but this construct makes it easy to edit things as a result of the second variable's value.

(This post was last modified: 07-20-2011, 03:56 PM by palistov.)
07-20-2011, 03:54 PM
Find


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



Users browsing this thread: 4 Guest(s)