kuplion 1785 Report post Posted March 29, 2016 Hey folks, I'm currently using the 'Attach Chemlight' addon, but it works via a button press (F5) to attach the chemlight. Would anyone be able to help me/point me in the right direction for creating an Action when a player is holding a chemlight and add the option to attach it to the scroll menu rather than pressing F5. Share this post Link to post Share on other sites
Teh Dango 136 Report post Posted March 29, 2016 (edited) 1 hour ago, kuplion said: Hey folks, I'm currently using the 'Attach Chemlight' addon, but it works via a button press (F5) to attach the chemlight. Would anyone be able to help me/point me in the right direction for creating an Action when a player is holding a chemlight and add the option to attach it to the scroll menu rather than pressing F5. Try this: null = player addAction ["<t color='#00a6eb'>Take Chemlight</t>", Path to script, Parameters to script, -10, true(to popup action when close), true(to hide action on use), "", "if (player distance chemLight < 1) then {true;} else {false;}"]; EDIT: You will need to make the chemLight name whatever the classname is for the chem light you are using. Edited March 29, 2016 by Teh Dango 1 Share this post Link to post Share on other sites
kuplion 1785 Report post Posted March 29, 2016 Ah man! Dango you legend! Thank you. Sorry to sound like a n00b though, but where am I putting this? Am I replacing part of the original addon with this? Share this post Link to post Share on other sites
Teh Dango 136 Report post Posted March 30, 2016 (edited) 10 minutes ago, kuplion said: Ah man! Dango you legend! Thank you. Sorry to sound like a n00b though, but where am I putting this? Am I replacing part of the original addon with this? Well first i edited a bunch cause I got lost lol. Aside from that you would want to put that in any part of the script that runs on the player, preferably something from the init.sqf file. I use an execution like this: _nul = execVM "folder\file.sqf"; and the file looks like this: waitUntil {sleep 0.5;!isNull (findDisplay 46);}; null = player addAction ["<t color='#00a6eb'>Take Chemlight</t>", Path to script, Parameters to script, -10, true(to popup action when close), true(to hide action on use), "", "if (player distance chemLight < 1) then {true} else {false}"]; Now dont hold me to this as I have not tested it lol but this is the idea to get it working. I use this for my dog companion script, yup, dogs and it works only when they are around otherwise the action is gone. This is just one of many ways and honestly its a bit noob level but it works lol. Edited March 30, 2016 by Teh Dango 1 Share this post Link to post Share on other sites
kuplion 1785 Report post Posted March 30, 2016 Thank you, dude. That's how I call most of my custom stuff so I figured as much but just wanted to check. I'll give it a whirl and see how it works. Thank you again. Share this post Link to post Share on other sites
Teh Dango 136 Report post Posted March 30, 2016 I edited the thing and i think it may work better with true false instead of true; false; 1 Share this post Link to post Share on other sites
Havoc302 9 Report post Posted April 8, 2016 (edited) I'm trying everything to get addActions to work but I can't get one to come up at all, I've disabled almost all of Infistar trying because I thought it might have been something in there. My code posted below, no idea why it doesn't work. if (ExileClientPlayerIsBambi = true) then { _weaponoption = player addAction ["<t color='#FF0000'>Take out the gun stashed in your undies!</t>", "custom\PIU\doPIU.sqf"]; sleep 5; }; Even tried this just to test and nothing: if (true) then { player addAction ["Tits", ""]; }; Edited April 8, 2016 by Havoc302 Share this post Link to post Share on other sites