Jump to content
Sign in to follow this  
reggaeman007jah

[solved] engineOn by proximity to player?

Recommended Posts

Hi all,

 

I am sorry for the simple question, I hope you can help me out with this..

 

I have two unitPlay helis for a mission, and I would like both helis to fire up (i.e. engineOn) when I walk near them (instead of the engines both being on from the start of the mission - as per 'engineOn true' in the init of the heli). Could someone be kind enough to suggest the line of code needed in the proximity trigger to make this happen please?

 

Again, sorry for such a simple question..

 

Thank you

Share this post


Link to post
Share on other sites

Add this to init field of helicopter.

 

_e = this spawn 
{
	waitUntil { sleep 0.5; (_this distance player) < 10 };
	_this engineOn true;
};

Not tested

 

 

Share this post


Link to post
Share on other sites

change

[this]

 

to

this

 

since you are refering to it with _this inside the code and not _this select 0.

 

also that code he posted is made for the init line not a proximity trigger. just a heads up.

Share this post


Link to post
Share on other sites
15 hours ago, M1ke_SK said:

Add this to init field of helicopter.

 


_e = this spawn 
{
	waitUntil { sleep 0.5; (_this distance player) < 10 };
	_this engineOn true;
};

Not tested

 

 

 

Worked like a treat mate - THANK YOU !!! :) 

 

Made my day 

 

 

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  

×