BlacKnightBK 47 Posted March 8, 2017 Hello guys, I have created the arsenal script with the help of many of you, especially Serena :) Been trying to play around with it for a while by trying to remove the arsenal. I only want the player to be able to open the arsenal once, however, i have no idea how to remove it. Thanks Share this post Link to post Share on other sites
Guest Posted March 8, 2017 Hello, If you are using an addAction you may do something like this. Obj addAction ["MyAction", { // Code for Arsenal opening; removeAction (_this select 2); }]; https://community.bistudio.com/wiki/addAction https://community.bistudio.com/wiki/removeAction :) Share this post Link to post Share on other sites
BlacKnightBK 47 Posted March 8, 2017 13 minutes ago, harmdhast said: Hello, If you are using an addAction you may do something like this. Obj addAction ["MyAction", { // Code for Arsenal opening; removeAction (_this select 2); }]; https://community.bistudio.com/wiki/addAction https://community.bistudio.com/wiki/removeAction :) The thing is this is not how the arsenal action gets created, therefore I do not have an action ID to remove it. Share this post Link to post Share on other sites
serena 151 Posted March 8, 2017 Apparently now is the right time to ask how you open your arsenal? Or maybe we should guess it? Share this post Link to post Share on other sites
BlacKnightBK 47 Posted March 8, 2017 18 minutes ago, serena said: Apparently now is the right time to ask how you open your arsenal? Or maybe we should guess it? I am so ver sorry, I am such an idiot, trying to do my homework as well as this so when I ask a question I am brain dead. [ armorer, _contents, false, true ] call BIS_fnc_addVirtualBackpackCargo; if i can open my custom arsenal using an action key would be great, plz let me know, thanks Share this post Link to post Share on other sites
BlacKnightBK 47 Posted March 8, 2017 30 minutes ago, serena said: Apparently now is the right time to ask how you open your arsenal? Or maybe we should guess it? I am so ver sorry, I am such an idiot, trying to do my homework as well as this so when I ask a question I am brain dead. [ armorer, _contents, false, true ] call BIS_fnc_addVirtualBackpackCargo; if i can open my custom arsenal using an action key would be great, plz let me know, thanks Share this post Link to post Share on other sites
serena 151 Posted March 8, 2017 In that case, your question might sound like this: how do I remove Arsenal action added by BIS_fnc_addVirtualBackpackCargo function. It is important, because the right question contains half the answer. RemoveArsenalActionFromGivenObject = { {if (_this actionParams _x select 0 == "Arsenal") exitWith {_this removeAction _x}} forEach actionIDs _this; }; // Test: [player, "B_AssaultPack_mcamo_Ammo", false, true] call BIS_fnc_addVirtualBackpackCargo; player call RemoveArsenalActionFromGivenObject; 1 Share this post Link to post Share on other sites
BlacKnightBK 47 Posted March 8, 2017 54 minutes ago, serena said: In that case, your question might sound like this: how do I remove Arsenal action added by BIS_fnc_addVirtualBackpackCargo function. It is important, because the right question contains half the answer. RemoveArsenalActionFromGivenObject = { {if (_this actionParams _x select 0 == "Arsenal") exitWith {_this removeAction _x}} forEach actionIDs _this; }; // Test: [player, "B_AssaultPack_mcamo_Ammo", false, true] call BIS_fnc_addVirtualBackpackCargo; player call RemoveArsenalActionFromGivenObject; You are amazing, is there anything you can't do?? And I am sorry. In future, I will put much thought into my question before I ask by providing all the information 1 Share this post Link to post Share on other sites
killzone_kid 1333 Posted March 8, 2017 5 hours ago, BlacKnightBK said: Hello guys, I have created the arsenal script with the help of many of you, especially Serena :) Been trying to play around with it for a while by trying to remove the arsenal. I only want the player to be able to open the arsenal once, however, i have no idea how to remove it. Thanks https://community.bistudio.com/wiki/BIS_fnc_removeVirtualBackpackCargo maybe? Share this post Link to post Share on other sites
BlacKnightBK 47 Posted March 8, 2017 58 minutes ago, killzone_kid said: https://community.bistudio.com/wiki/BIS_fnc_removeVirtualBackpackCargo maybe? That removes items from the virtual arsenal, I wanted to remove the action completely. Thanks but Serena already helped me with that and problem solved. Share this post Link to post Share on other sites
killzone_kid 1333 Posted March 8, 2017 It is the opposite of BIS_fnc_addVirtualBackpackCargo; You add it use it remove it Share this post Link to post Share on other sites
serena 151 Posted March 8, 2017 11 minutes ago, BlacKnightBK said: That removes items from the virtual arsenal, I wanted to remove the action completely. Thanks but Serena already helped me with that and problem solved. This function deletes action as well [player, "B_AssaultPack_mcamo_Ammo", false, true] call BIS_fnc_addVirtualBackpackCargo; [player, "B_AssaultPack_mcamo_Ammo", false] call BIS_fnc_removeVirtualBackpackCargo; Share this post Link to post Share on other sites
serena 151 Posted March 8, 2017 1 hour ago, killzone_kid said: You add it use it remove it Description says: Returns: ARRAY of ARRAYs - all virtual items within the object's space in format [<items>,<weapons>,<magazines>,<backpacks>] [player, ["B_AssaultPack_mcamo_Ammo"], false, true] call BIS_fnc_addVirtualBackpackCargo; //Result: ["B_AssaultPack_mcamo_Ammo"] //Expected: [[], [], [], ["B_AssaultPack_mcamo_Ammo"]] Something went wrong? Share this post Link to post Share on other sites
Midnighters 152 Posted March 16, 2017 Wait a sec, isn't there a control like "bisArsenalCamera" I know for sure that's not correct. But I believe at one point in time Larrow was able to add the arsenal without calling bis_fnc_removeVirtualEtc . Share this post Link to post Share on other sites