baleen 10 Posted September 22, 2016 I'm trying to combine addaction and bis_fnc_initAmmoBox is it correct? please help me MHQ_3 addAction[("<t color='#ff1111'>") + ("Open Virtual Arsenal") + "</t>", {[_this,_value] call bis_fnc_initAmmoBox; class Value { class data { class type { type[]= { "STRING" }; }; value="[[[[""arifle_MX_F"",""FirstAidKit""],[2,10]],[[""30Rnd_65x39_caseless_mag"",""100Rnd_65x39_caseless_mag"",""HandGrenade"",""1Rnd_HE_Grenade_shell"",""1Rnd_Smoke_Grenade_shell"",""1Rnd_SmokeGreen_Grenade_shell"",""1Rnd_SmokeOrange_Grenade_shell"",""1Rnd_SmokeBlue_Grenade_shell"",""16Rnd_9x21_Mag"",""SmokeShell"",""SmokeShellGreen"",""SmokeShellOrange"",""SmokeShellBlue""],[16,6,10,10,4,4,4,4,12,4,4,4,4]],[[],[]],[[],[]]],false]"; }; }; } ]; Share this post Link to post Share on other sites
R3vo 2652 Posted September 23, 2016 You are mixing c++ with sqf here. What exactly do you want to do? Create an Arsenal with predefined equipment? Then you should look here Share this post Link to post Share on other sites
Larrow 2779 Posted September 24, 2016 Your mixing sqf with a sqm data structure for an editor attribute and the items array your have shown is for cargo(not VA) as the last parameter is false. There is no need for the quantity values when initialising a VA as they have no meaning, when using a VA you can access as many of each item available as you like. Also you have a FisrtAidKit in the weapon array, it need to be an item (index 2) BIS_fnc_initAmmoBox when used to initialise a virtual Arsenal will already add an action for you. Just place this in the objects(MHQ_3) initBox in the editor... [this,[[[["arifle_MX_F"]],[["30Rnd_65x39_caseless_mag","100Rnd_65x39_caseless_mag","HandGrenade","1Rnd_HE_Grenade_shell","1Rnd_Smoke_Grenade_shell","1Rnd_SmokeGreen_Grenade_shell","1Rnd_SmokeOrange_Grenade_shell","1Rnd_SmokeBlue_Grenade_shell","16Rnd_9x21_Mag","SmokeShell","SmokeShellGreen","SmokeShellOrange","SmokeShellBlue"]],[["FirstAidKit"]],[[]]],true]] call bis_fnc_initAmmoBox; The above is no different than using the editor to select what items you want available by using the objects attribute "equipment storage" set to Virtual. If you want to add your own action text as you have shown then you will need to refer to the link R3vo has provided and use the BIS_fnc_addVirtual#Cargo functions, passing each one the relevant data from your items array. You will also need to use false in the call to BIS_fnc_addVirtual#Cargo as param 3 to stop the functions adding their own action for the virtual arsenal to the object. Then add an action that uses the "Open" variant as shown in R3vo's link. [ this, ["arifle_MX_F"], true, false ] call BIS_fnc_addVirtualWeaponCargo; [ this, ["30Rnd_65x39_caseless_mag","100Rnd_65x39_caseless_mag","HandGrenade","1Rnd_HE_Grenade_shell","1Rnd_Smoke_Grenade_shell","1Rnd_SmokeGreen_Grenade_shell","1Rnd_SmokeOrange_Grenade_shell","1Rnd_SmokeBlue_Grenade_shell","16Rnd_9x21_Mag","SmokeShell","SmokeShellGreen","SmokeShellOrange","SmokeShellBlue"], true, false ] call BIS_fnc_addVirtualMagazineCargo; [ this, ["FirstAidKit"], true, false ] call BIS_fnc_addVirtualItemCargo; this addAction[("<t color='#ff1111'>") + ("Open Virtual Arsenal") + "</t>",{ params[ "_target", "_caller" ]; ["Open",[nil,_target,_caller]] call bis_fnc_arsenal; }]; TBH i think you have been peaking in the sqm and got yourself confused by what you have seen there. 1 Share this post Link to post Share on other sites
dlder 13 Posted February 8, 2021 THANKS, I've searched quite a couple of times and never found out how to open BiS Arsenal with custom text 🙂 Share this post Link to post Share on other sites