Aphec 10 Posted January 1, 2014 i'm trying to add an action only to WEST side players, i'm failing to do so, anyone could offer some help? life_actions = life_actions + [player addAction["Take Small Barrier.",life_fnc_packupbarriersmall,"",0,false,false,"", ' _barriersmall = nearestObjects[getPos player,["RoadBarrier_small_F"],8] select 0; !isNil "_barriersmall" && !isNil {(_barriersmall getVariable "item")}']]; Share this post Link to post Share on other sites
Johnson11B2P 3 Posted January 1, 2014 For the condition parameter of the addAction. Make it so that the target belongs on side west. ID = unit addAction [title, script, arguments, priority, showWindow, hideOnUse, shortcut, condition //Either put this code in the function so it can be called for the condition or place it where it can be completed. _check = side _this select 1 == west; life_actions = life_actions + [player addAction["Take Small Barrier.",life_fnc_packupbarriersmall,"",0,false,false,"",_check]; Share this post Link to post Share on other sites
Aphec 10 Posted January 1, 2014 hmm, didnt really seem to have pulled it, if you feel like maybe we can try some things out on steam? Share this post Link to post Share on other sites
noven 14 Posted January 2, 2014 assuming the previous code works just add && (playerSide == west) as I've done below. Noticed there was a space on the second false ( e.g. "f alse" ) on what you pasted, which could be a big problem. life_actions = life_actions + [player addAction["Take Small Barrier.",life_fnc_packupbarriersmall,"",0,false,false,"", ' _barriersmall = nearestObjects[getPos player,["RoadBarrier_small_F"],8] select 0; !isNil "_barriersmall" && !isNil {(_barriersmall getVariable "item")} && (playerSide == west) ']]; Share this post Link to post Share on other sites
fusion13 11 Posted January 3, 2014 Sorry if you got it already but just use, if (side == west) then { life_actions = life_actions + [player addAction["Take Small Barrier.",life_fnc_packupbarriersmall,"",0,false,f alse,"", ' _barriersmall = nearestObjects[getPos player,["RoadBarrier_small_F"],8] select 0; !isNil "_barriersmall" && !isNil {(_barriersmall getVariable "item")} && (playerSide == west) ']]; }; Or something like that Share this post Link to post Share on other sites
tonic-_- 53 Posted January 3, 2014 The fn_setupActions.sqf already has blocks for civilian specific actions or blufor. switch (playerSide) do { case west: { //Actions are here for cops }; case civilian: { //Actions are here for civilians }; }; Share this post Link to post Share on other sites
Aphec 10 Posted January 8, 2014 Hey Tonic, yeah i figured it out eventually however there is an extremely weird bug in Arma code, when you place a barrier and you want to put it back in your inventory, it will allow you to put it back as a cone or a barrier both work :) ive tested this with many different codes, always get the same result, very very weird :) Share this post Link to post Share on other sites