Jump to content
Sign in to follow this  
Timo Hinse

Player distance BIS_fnc_holdActionAdd

Recommended Posts

Hello...

Im trying to get a addaction on holt whit a distance < 1m

This works but whit a distance <~3m

[
	heli1,
	"<t color='#FF0000'>TAKE OFF</t>",
	"a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_takeOff1_ca.paa",
	"a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_takeOff1_ca.paa",
	"true",
	"true",
	{},
	{},
	{MLT_Helitakeoff = true; publicVariable "MLT_Helitakeoff";},
	{},
	[],
	1,
	nil,
	true,
	false
] call BIS_fnc_holdActionAdd;

if i try this:

[
	heli1,
	"<t color='#FF0000'>TAKE OFF</t>",
	"a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_takeOff1_ca.paa",
	"a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_takeOff1_ca.paa",
	"_this distance _target < 1",
	"_caller distance _target < 1",
	{},
	{},
	{MLT_Helitakeoff = true; publicVariable "MLT_Helitakeoff";},
	{},
	[],
	1,
	nil,
	true,
	false
] call BIS_fnc_holdActionAdd;

the addaction will not show.

Share this post


Link to post
Share on other sites

If it's attached to a vehicle and you want the pilot to execute it, change the distance check to something like this:
 

"_this==driver _target",
"_caller==driver _target"

Something like that. The center position of vehicles is often more than 1m from the seat position of a vehicle, hence why it normally would work 1.6m+ away. Basically, replace the distance check with if the person calling the code is in the vehicle (as a driver or whatever position you're looking for)

  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, phronk said:

why it normally would work 1.6m+ away.

That worked... thank you.

 

In heli, the action can now be performed from inside and at ohter objekts the action is very close to the object

Share this post


Link to post
Share on other sites

I spawned it within a trigger radius, just incase that is not always an option. 

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  

×