Jump to content
Sign in to follow this  
coolfact

addaction for vehicle crew

Recommended Posts

I want the addaction to work only for vehicle crew and when vehicle is standing still, I have tried following in the unit init, but don't work :S

this addAction ["Deploy MHQ", "missionscripts\Deploy.sqf", [this], 0, false, false, "", "player in (crew this) && speed this == 0"];

what am I doing wrong?

Share this post


Link to post
Share on other sites

Try (_this select 0) instead of this, or maybe just "_this".

Share this post


Link to post
Share on other sites

Assuming the addAction is added to the vehicle;

this addAction ["Deploy MHQ", "missionscripts\Deploy.sqf", [], 0, false, false, "", "_this in (crew _target) && {speed _target < 1}"];

wiki:

Special variables passed to the script code are _target (unit to which action is attached to) and _this (caller/executing unit).

Share this post


Link to post
Share on other sites
Assuming the addAction is added to the vehicle;

this addAction ["Deploy MHQ", "missionscripts\Deploy.sqf", [], 0, false, false, "", "_this in (crew _target) && {speed _target < 1}"];

wiki:

Special variables passed to the script code are _target (unit to which action is attached to) and _this (caller/executing unit).

Thanks Iceman, knew it was something along the lines of that :p.

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  

×