JacobJ 10 Posted November 2, 2010 Hey I have added an action to a unit, but by now all other players on his team can access this menu. Is there anyway to only let the player with the addaction in his init use the action? Share this post Link to post Share on other sites
shuko 59 Posted November 2, 2010 addaction command takes a condition as it's last parameter, you should look into that. Share this post Link to post Share on other sites
JacobJ 10 Posted November 2, 2010 Could you explain how to use those commands, I havnt been able to get the hideOnUse to work and I think I am doing something wrong. command = player1 addaction ["Start game", "confirm.sqf", (hideonuse)]; Share this post Link to post Share on other sites
nuxil 2 Posted November 2, 2010 check out the biki it has all info need for addaction http://community.bistudio.com/wiki/addAction condition: String - (optional, Arma 2 only, default:true) Code that must return true for action to be shown. Special variables "_target" (unit to which action is attached to) and "_this" (caller/executing unit) can be used in the evaluation.so you might want someting like "_target == _this" in the condition Share this post Link to post Share on other sites
st_dux 26 Posted November 2, 2010 Alternatively, just put the addAction in an if statement, e.g.: if (player == <guywhoshouldhavetheaction>) then {player addAction [blahblahblah..]} Share this post Link to post Share on other sites
DasClark 10 Posted September 19, 2013 in this example.... check out the biki it has all info need for addactionhttp://community.bistudio.com/wiki/addAction so you might want someting like "_target == _this" in the condition this works exactly as desired until the player enters a vehicle. Then _this no longer equals target (because the player is now the vehicle instead of the player in the vehicle). Is there a sexy way to pull this off without a ton of lines? Something along the lines of ((_this == _target) or (vehicle _this == _target)). Thanks DasClark Share this post Link to post Share on other sites
xxanimusxx 2 Posted September 19, 2013 The init-field of the soldier/player: if (local this) then {actionID = this addAction [...];}; Share this post Link to post Share on other sites