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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help [Solved] Two Conditionals on same line?
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#3
RE: Two Conditionals on same line?

In some languages, you can write the keyword and as a substitute for &&. Similarly, you can use or for ||.

*You can't do this in AngelScript, but it explains their purpose.

PHP Code: (Select All)
if(GetLocalVarInt("can_craft") == && GetLocalVarInt("cant_craft") == -1

You can also do this, which has a slight difference:

PHP Code: (Select All)
if(GetLocalVarInt("can_craft") == 1) if(GetLocalVarInt("cant_craft") == -1

This would only ask the second if-statement if the first one passes. The top one will ask both in the same operation.

(This post was last modified: 06-10-2015, 04:12 PM by Mudbill.)
06-10-2015, 04:07 PM
Find


Messages In This Thread
RE: Two Conditionals on same line? - by Kreekakon - 06-10-2015, 03:53 PM
RE: Two Conditionals on same line? - by Romulator - 06-11-2015, 10:09 AM
RE: Two Conditionals on same line? - by Mudbill - 06-10-2015, 04:07 PM
RE: Two Conditionals on same line? - by Mudbill - 06-10-2015, 10:01 PM



Users browsing this thread: 1 Guest(s)