JacobJ 10 Posted October 5, 2010 Hello all Ive found a script to load ammo crates into ect. choppers and it uses a script to clear the action from the menu after use. It all works fine, but the problem is that it also removes the get out and jump actions from the menu when you are flying in the heli. I cant even use the bindings on my keyboard to get out while in the air. The remove script looks like this: // Grab the input. _mhq1 = _this select 0; // Remove all player added actions from the object. _action = _mhq1 addAction["foo", "foo.sqf"]; while {_action >= 0} do { _mhq1 removeAction _action; _action = _action - 1; }; I dont have any units called mhq1, but it seem to work no matter what the unit is called and if I rename it to fit the unit it doesnt work. hope you can help me out here. /Jacob Share this post Link to post Share on other sites
Joshii 10 Posted October 5, 2010 (edited) while {_action >= 0} do { This is the problem I guess. not the unit name or anything the unit name is a variable that is send the script that's why it's _this select 0; Anyhow I would suggest you to write your own script to to do the things you want otherwise it will be a tough thing to debug it as you don't know how it works. If you dont wanna write it yourself then post the initalizitation in here aswell otherwise I wont be able to help you Edited October 5, 2010 by Joshii Share this post Link to post Share on other sites
buliwyf 4 Posted October 5, 2010 Put in your foo.sqf: _obj = _this select 0; _id = _this select 2; _obj removeAction _id; :rolleyes: Learn more about addAction here: >> click << Share this post Link to post Share on other sites
kylania 568 Posted October 5, 2010 What Buliwyf said. :) Share this post Link to post Share on other sites
JacobJ 10 Posted October 5, 2010 Okay thanks for the help. Ive removed the old script as suggested in the first post here and wrote my own and now it works like a charme. Ill note the other possibility suggested and see if its easier, but for now it works. Thanks for the post! Share this post Link to post Share on other sites