imutep 0 Posted November 30, 2008 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. <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
Linker Split 0 Posted November 30, 2008 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
t_d 47 Posted November 30, 2008 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
imutep 0 Posted November 30, 2008 Thx a lot for help. I will try out! Share this post Link to post Share on other sites
Deadfast 43 Posted December 2, 2008 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