Jump to content
Sign in to follow this  
Terran4999

Heli fly in height command

Recommended Posts

Hey

I just want to know if this command is correct:

Quote[/b] ] "_X flyinheight 50" foreach units this

If this is a valid command why is it not working? I tried putting this in the WP Activation and well as in the Init of units

Share this post


Link to post
Share on other sites

Almost right mate. The foreach operator then expects an array to follow. Looks like by using the syntax:

foreach this

you're trying to run the code line on an object. Try:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"_x flyinheight 50" foreach units group player

or

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"_x flyinheight 50" foreach units mygroup

Share this post


Link to post
Share on other sites

No, that is actually correct syntax and data type wise (hence, no error message). units will return an array of units to forEach from the group or unit that is its parameter (ie, this in the WP onActivation). However, when you use units you will try to set the flyInHeight for the soldier, not the vehicle he's flying.

This will work:

"vehicle _x flyinheight 5" foreach units this

Share this post


Link to post
Share on other sites

I see, so if I did the following:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"_x dosomething parameter" foreach units player

Will this cause the dosomething and parameter code to be excuted on every unit in the group that the player is in?

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  

×