Jump to content
Sign in to follow this  
Prospero

Evaluating bools in ? statements

Recommended Posts

OK,

Say I'm trying to write something this:

?(canStand player == true): <do something>

Why does OFP throw an error? The canStand function returns a BOOL, true or false. Why can't I evaluate it this way?

I've also tried:

?(canStand player == "true")

... and also...

?(canStand player == 1)

But nothing seems to work. Help;)

Prospero.

Share this post


Link to post
Share on other sites

try

?(canstand player) :.....

the "canstand player" itself is true or false, so you don't have to compare it.

If you want to use the "false"-value you use:

?!(canstand player) :.....

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Rastavovich @ Nov. 06 2002,21:40)</td></tr><tr><td id="QUOTE">try

?(canstand player) :.....

the "canstand player" itself is true or false, so you don't have to compare it.

If you want to use the "false"-value you use:

?!(canstand player) :.....<span id='postcolor'>

Hehehe thanks yup, just got it. But thanks for the if-not version - I didn't know that!

Many thanks.

Prospero

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×