Kleshya 0 Posted October 12, 2017 For example, i place a laptop, and give it an action "Hack it". Blufor need to secure it, and Opfor need to hack. Obviously, blufor dont need this action, and i need to hide it from them. How can i do this? Share this post Link to post Share on other sites
Belbo 461 Posted October 12, 2017 One of the parameters for https://community.bistudio.com/wiki/addAction is "condition". There you can put something in like side (group player) == west to make it available only for one side. Share this post Link to post Share on other sites
Kleshya 0 Posted October 12, 2017 Thank you. And one more, how can i do the same for BIS_fnc_holdActionAdd function, and for multiple sides? Just enumeration using or, or something else? Share this post Link to post Share on other sites
Belbo 461 Posted October 12, 2017 Take a look at the documentation and you will find conditions for BIS_fnc_holdActionAdd as well. If you want multiple sides, use something like: side (group player) in [west,east] Share this post Link to post Share on other sites
HazJ 1288 Posted October 12, 2017 Or you can do an if statement with no condition before using the addAction command. Not sure if this is true or not but I heard using conditions or lots of heavy condition checks can have an impact on performance? Maybe someone can confirm whether this is true or not... Though, as that is just a side check it shouldn't really hurt I don't think. Quote Special variables passed to the script code are _target (object to which action is attached to) and _this (caller/executing person). (side _this == blufor) if ((side player == blufor)) then { // addAction... }; BIS_fnc_holdActionAdd: [player, "Kill", "", "", "(side _this == blufor)", "true", {hintSilent "Hello!";}, {systemChat str (_this select 4);}, {player setDamage 1;}, {hintSilent "Splat.";}, [], 10, nil, true, false] call BIS_fnc_holdActionAdd; (modified example from the Wiki) Share this post Link to post Share on other sites
Belbo 461 Posted October 12, 2017 Always use {side (group player)} instead of {side player}, as the side of the player may change to civilian (on setCaptive for example) or to enemy (on accidental team killing for example), but the side of his group does not change with that. Unless of course you specifically want that. 1 1 Share this post Link to post Share on other sites
HazJ 1288 Posted October 12, 2017 Oh, I didn't know that. Thanks! Will be useful in the future. Share this post Link to post Share on other sites