Neonz27 1 Posted September 28, 2020 I think the title is pretty self-explanatory, but I can provide my details if they are requested. I only need the action on playable units; not NPCs. Demonstrations would be very helpful. Share this post Link to post Share on other sites
avibird 1 154 Posted September 28, 2020 Yes you can pretty much add it to anything in the game you want playable units placeable objects even backpacks. Watch this video we'll explain everything. Share this post Link to post Share on other sites
wogz187 1086 Posted September 28, 2020 @Neonz27, It's just this, Spoiler { addAction } forEach playableUnits; so something like, { null=[ _x, "Generic Hold Action", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "\a3\ui_f\data\IGUI\Cfg\holdactions\holdAction_connect_ca.paa", "alive _this", "alive _this", {}, {}, { systemChat "Action Complete!"; }, {}, [], 2, 0, false, true] call BIS_fnc_holdActionAdd; } forEach playableUnits; playableUnits Have fun! 1 Share this post Link to post Share on other sites
pierremgi 4853 Posted September 29, 2020 Depending on what you want to do with your action... playableUnits are all slots (lobby) if you don't disable AIs in the lobby. If you disable them, you'll get just something equivalent to allPlayers, then depending on when you are running your code and the effective players. In SP, but I guess it's not the aim, you must use switchableUnits. Now, do you want to addAction on the player himself (self addAction) ? In this case, forget playableUnits, and add the action on the player when he is a player (initPlayerLocal.sqf) . And don't forget to run again the addAction after respawn. It's not persistent. 3 Share this post Link to post Share on other sites
ZaellixA 383 Posted September 30, 2020 pierremgi is right... If you want to add the action only to players you should place the addAction inside the initPlayerLocal.sqf and in addition to that inside the onPlayerRespawn.sqf which is run when a player is respawned. For more info on both initPlayerLocal.sqf and onPlayerRespawn.sqf and the arguments that are passed to them see this site. 1 1 Share this post Link to post Share on other sites