Jump to content
fortune144

UserAction - Arsenal

Recommended Posts

Hey there,

 

i would like to add the arsenal to my custom ReammoBox_F - box  in UserActions. The Problem is the arsenal opens only on click on my action then the action menu contains Uniforms and Arsenal. yeah i know with open i can solve the problem but then i cant add my custom classes to it.

 

class UserActions
		{
			class Rifleman_Uniform_Arsenal
			{
				displayName = "<t color='#FF9900'>Uniforms</t>";
				priority = 6;
				radius = 4;
				position = "camera";
				showWindow = 0;
				hideOnUse = 1;
				onlyForPlayer = 1;
				condition = true;
				statement = "[this] execVM ""crates\data\arsenal.sqf"";";
			};
		};

 

arsenal.sqf

 

_crate = _this select 0;

["AmmoboxInit",[_crate, false, {true}]] spawn BIS_fnc_arsenal;

_availableHeadgear = [
	"UK3CB_BAF_H_Wool_Hat"
];

_availableUniforms = [
	"UK3CB_BAF_U_Smock_DPMW"
];

[_crate,((itemCargo _crate) + _availableHeadgear + _availableUniforms), false, true] call BIS_fnc_addVirtualItemCargo;

 

Share this post


Link to post
Share on other sites
On 12/9/2018 at 12:52 PM, fortune144 said:

yeah i know with open i can solve the problem but then i cant add my custom classes to it.

Of course you can, virtual items are not evaluated until after the Arsenal gui initialises, which is handle after "Open".

You just need to add your items before calling Open.

_crate = _this select 0;

_availableHeadgear = [
	"UK3CB_BAF_H_Wool_Hat"
];

_availableUniforms = [
	"UK3CB_BAF_U_Smock_DPMW"
];

[_crate,((itemCargo _crate) + _availableHeadgear + _availableUniforms), false, true] call BIS_fnc_addVirtualItemCargo;

["Open",[ false, _crate, player ]] spawn BIS_fnc_arsenal;

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×