Jump to content
Sign in to follow this  
imutep

Height of flying choppper for condition

Recommended Posts

Gday

I've had a question, but find no answer till now. I need a script command, that reads the height of my flying heli. Whenn the heli is flying in height 20 meters, then comes a hint.

I tested it with this one, but there comes a error message. confused_o.gif

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (getpos heli select 2) > 20 then {hint "You are flying too high!"} else {hint "You fly in optimal height!"}

Should i use the setPosASL command? I have no idea. Hope anybody can help me.

Thx Imutep

Share this post


Link to post
Share on other sites

just try:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_chop _ this select 0

#START

? (position _chop select 2) > 20 : hint "You are flying too high!"

hint "You fly in optimal height!"

~0.1

goto "START"

of course in the init line of the chopper write

Quote[/b] ][this] exec "script.sqs"

Share this post


Link to post
Share on other sites

You need brackets around the whole condition:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if ((getpos heli select 2) > 20) then {hint "You are flying too high!"} else {hint "You fly in optimal height!"}

Share this post


Link to post
Share on other sites

Thx a lot for help. I will try out!

Share this post


Link to post
Share on other sites

Actually you're also missing a few semi-columns.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

if ((getpos heli select 2) > 20) then {hint "You are flying too high!";} else {hint "You fly in optimal height!";};

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  

×