Jump to content
Sign in to follow this  
jmuirhead20

Virtual Arsenal Whitelist Attachments help.

Recommended Posts

I am trying to make it so that only Nato weapons and gear are in the Virtual Arsenal, but no attachments are showing up. Using this way to do this: https://www.reddit.com/r/armadev/comments/2eg7ks/virtual_arsenal_restricting_items/

 Here's my current code

_crate = _this select 0;

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

_availableHeadergear = [


];
_availableGoogles = [

"NVGoggles",
"NVGoggles_INDEP",
"NVGoggles_OPFOR"

];
_availableUniforms = [

];
_availableVests = [


];
_availableBackbacks = [


];
_availableWeapons = [
	"launch_B_Titan_F",
	"launch_I_Titan_F",
	"srifle_EBR_F",
	"srifle_GM6_F",
	"srifle_LRR_F",
	"LMG_Mk200_F",
	"hgun_ACPC2_F",
	"hgun_P07_F",
	"arifle_MXC_F",
	"arifle_MX_F",
	"arifle_MX_GL_F",
	"arifle_MX_SW_F",
	"arifle_MXM_F",
	"arifle_MX_SW_F",
	"arifle_MXC_Black_F",
	"arifle_MX_Black_F",
	"arifle_MX_GL_Black_F",
	"arifle_MX_SW_Black_F",
	"arifle_MXM_Black_F",
	"SMG_01_F",
	"srifle_GM6_camo_F",
	"srifle_DMR_03_F",
	"srifle_DMR_02_F",
	"srifle_DMR_02_camo_F",
	"srifle_DMR_02_sniper_F",
	"srifle_DMR_03_khaki_F",
	"srifle_DMR_03_tan_F",
	"srifle_DMR_03_multicam_F",
	"srifle_DMR_03_woodland_F",
	"srifle_DMR_06_camo_F",
	"srifle_DMR_06_olive_F",
	"MMG_02_camo_F",
	"MMG_02_black_F",
	"MMG_02_sand_F"

];
_availableMagazines = [

"10Rnd_762x51_Mag",
"11Rnd_45ACP_Mag",
"150Rnd_762x51_Box",
"150Rnd_762x51_Box_Tracer",
"200Rnd_65x39_Belt",
"200Rnd_65x39_Belt_Tracer_Green",
"200Rnd_65x39_Belt_Tracer_Red",
"200Rnd_65x39_Belt_Tracer_Yellow",
"20Rnd_556x45_UW_mag",
"20Rnd_762x51_Mag",
"30Rnd_45ACP_Mag_SMG_01",
"30Rnd_45ACP_Mag_SMG_01_Tracer_Green",
"30Rnd_556x45_Stanag",
"30Rnd_556x45_Stanag_Tracer_Green",
"30Rnd_556x45_Stanag_Tracer_Red",
"30Rnd_556x45_Stanag_Tracer_Yellow",
"30Rnd_65x39_caseless_green",
"30Rnd_65x39_caseless_green_mag_Tracer",
"30Rnd_65x39_caseless_mag",
"30Rnd_65x39_caseless_mag_Tracer",
"16Rnd_9x21_Mag",
"30Rnd_9x21_Mag",
"5Rnd_127x108_APDS_Mag",
"5Rnd_127x108_Mag",
"6Rnd_45ACP_Cylinder",
"7Rnd_408_Mag",
"9Rnd_45ACP_Mag",
"130Rnd_338_Mag",
"1Rnd_HE_Grenade_shell",
"1Rnd_Smoke_Grenade_shell",
"1Rnd_SmokeBlue_Grenade_shell",
"1Rnd_SmokeGreen_Grenade_shell",
"1Rnd_SmokeOrange_Grenade_shell",
"1Rnd_SmokePurple_Grenade_shell",
"1Rnd_SmokeRed_Grenade_shell",
"1Rnd_SmokeYellow_Grenade_shell",
"3Rnd_HE_Grenade_shell",
"3Rnd_Smoke_Grenade_shell",
"3Rnd_SmokeBlue_Grenade_shell",
"3Rnd_SmokeGreen_Grenade_shell",
"3Rnd_SmokeOrange_Grenade_shell",
"3Rnd_SmokePurple_Grenade_shell",
"3Rnd_SmokeRed_Grenade_shell",
"3Rnd_SmokeYellow_Grenade_shell",
"3Rnd_UGL_FlareCIR_F",
"3Rnd_UGL_FlareGreen_F",
"3Rnd_UGL_FlareRed_F",
"3Rnd_UGL_FlareWhite_F",
"3Rnd_UGL_FlareYellow_F",
"APERSBoundingMine_Range_Mag",
"APERSMine_Range_Mag",
"APERSTripMine_Wire_Mag",
"ATMine_Range_Mag",
"ClaymoreDirectionalMine_Remote_Mag",
"DemoCharge_Remote_Mag",
"SatchelCharge_Remote_Mag",
"SLAMDirectionalMine_Wire_Mag"






];



_availableAttachments = [
"muzzle_snds_H",
"muzzle_snds_L",
"muzzle_snds_M",
"muzzle_snds_B",
"muzzle_snds_H_MG",
"muzzle_snds_H_SW",
"optic_Arco",
"optic_Hamr",
"optic_Aco",
"optic_ACO_grn",
"optic_Aco_smg",
"optic_ACO_grn_smg",
"optic_Holosight",
"optic_Holosight_smg",
"optic_SOS",
"acc_flashlight",
"acc_pointer_IR",
"optic_MRCO",
"muzzle_snds_acp",
"optic_NVS",
"optic_Nightstalker",
"optic_tws",
"optic_tws_mg",
"optic_DMS",
"optic_MRD",
"optic_LRPS",
"muzzle_snds_338_black",
"muzzle_snds_338_green",
"muzzle_snds_338_sand",
"muzzle_snds_93mmg",
"muzzle_snds_93mmg_tan",
"optic_AMS",
"optic_AMS_khk",
"optic_AMS_snd",
"optic_KHS_blk",
"optic_KHS_hex",
"optic_KHS_old",
"optic_KHS_tan",
"bipod_01_F_snd",
"bipod_01_F_blk",
"bipod_01_F_mtp",
"bipod_02_F_blk",
"bipod_02_F_tan",
"bipod_03_F_blk",
"bipod_03_F_oli"
];


_availableEquipment = [

"Binocular",
"FirstAidKit",
"ItemCompass",
"ItemGPS",
"ItemMap",
"ItemRadio",
"ItemWatch",
"Medikit",
"MineDetector",
"ToolKit"

];

[_crate,((backpackCargo _crate) + _availableBackpacks)] call BIS_fnc_addVirtualBackpackCargo;
[_crate,((itemCargo _crate) + _availableHeadgear + _availableGoggles + _availableUniforms + _availableVests + _availableEquipment)] call BIS_fnc_addVirtualItemCargo;
[_crate,((magazineCargo _crate) + _availableMagazines)] call BIS_fnc_addVirtualMagazineCargo;
[_crate,((weaponCargo _crate) + _availableWeapons)] call BIS_fnc_addVirtualWeaponCargo;

Share this post


Link to post
Share on other sites

initserver.sqf

execvm "VA_box.sqf";
VA_box.sqf

// Check if box1 exists
 if (isNil "box1") exitWith { };

[box1, [
// ==================== ITEMS =====================

// Uniforms
"rhs_uniform_gorka_r_g",

// Headgear
"rhs_6b28",
"rhs_6b28_ess",
"rhs_balaclava1_olive",
"rhs_balaclava",


// Vests
"rhs_6b23_digi_6sh92",
"rhs_6b23_digi_6sh92_headset",
"rhs_6b23_digi_6sh92_radio",
"rhs_6b23_digi_medic",
"rhs_6b23_digi_vydra_3m",


// Suppressors
"rhs_acc_tgpa",
"rhs_acc_dtk4short",
"rhs_acc_dtk4screws",

"RH_pmsd",

// Flashlight
"rhs_acc_2dpZenit",

// Scopes
"rhs_acc_pkas",
"rhs_acc_1p63",


// General
"rhsusf_ANPVS_14",
"rhsusf_ANPVS_15",
"A3_GPNVG18_BLK_F",
"itemradio", 
"itemmap", 
"itemcompass", 
"itemwatch",
"ACE_Vector",
"ACE_DefusalKit",
"ACE_Clacker",
"ACE_Altimeter",
"ACE_UAVBattery",
"ACE_wirecutter",
"ACE_key_lockpick",
"ACE_IR_Strobe_Item",
"B_UAVTerminal",

// Meds
'ace_fieldDressing',
"ACE_elasticBandage",
'ace_tourniquet',
'ace_packingbandage'



], true] call BIS_fnc_addVirtualItemCargo;


[box1, [

// ==================== WEAPONS =====================

// ===================== RHS ========================
"rhs_weap_asval",
"rhs_weap_ak105",
'rhs_weap_ak103_gp25',
'rhs_weap_ak103',
"rhs_weap_ak74m_2mag_camo",
"rhs_weap_ak74m",

"rhs_weap_pkp",

"rhs_weap_rpg7",
"rhs_weap_rpg26",
"rhs_weap_rshg2",


// =================== Sidearms =====================
"RH_mak"



], true] call BIS_fnc_addVirtualweaponCargo;


[box1, [

// =================== MAGAZINES =====================

// =================== RHS =====================
"rhs_30Rnd_545x39_AK",
"rhs_100Rnd_762x54mmR",
"rhs_30Rnd_762x39mm",

"rhs_VOG25",
"rhs_VOG25P",
"rhs_VG40TB",
"rhs_VG40SZ",
"rhs_VG40OP_white",
"rhs_VG40OP_green",
"rhs_VG40OP_red",
"rhs_GRD40_White",
"rhs_GRD40_Green",
"rhs_GRD40_Red",
"rhs_VG40MD_White",
"rhs_VG40MD_Green",
"rhs_VG40MD_Red",
"rhs_GDM40",

"rhs_20rnd_9x39mm_SP5",
"rhs_20rnd_9x39mm_SP6",

"rhs_rpg7_PG7VR_mag",
"rhs_rpg7_TBG7V_mag",
"rhs_rpg7_OG7V_mag",
"rhs_rpg7_PG7VL_mag",

"RH_8Rnd_9x18_Mak",


// =================== OTHER =====================
"rhs_GRD40_White",
"rhs_GRD40_Green",
"rhs_GRD40_Red",
"rhs_VG40OP_red",
"rhs_VG40OP_green",
"rhs_VG40OP_white",
"rhs_VOG25",

"smokeshell",
"smokeshellred",
"smokeshellgreen",
"smokeshellyellow",
"smokeshellpurple",
"HandGrenade",
"chemlight_green",
"chemlight_red",
"chemlight_yellow",
"chemlight_blue",
"ACE_M84",
"ACE_HandFlare_Yellow",
"ACE_HandFlare_Green",
"ACE_HandFlare_Red",
"ACE_HandFlare_White",
"B_IR_Grenade",

"SLAMDirectionalMine_Wire_Mag",
"APERSTripMine_Wire_Mag",
"APERSBoundingMine_Range_Mag",
"ClaymoreDirectionalMine_Remote_Mag",
"DemoCharge_Remote_Mag",
"SatchelCharge_Remote_Mag"

], true] call BIS_fnc_addVirtualmagazineCargo;


[box1, [
// Backpacks
"B_UAV_01_backpack_F",
"b_parachute",


// Radiopacks
"tf_rt1523g_black",
"TFA_511_GRN",
"tf_rt1523g_fabric"


], true] call BIS_fnc_addVirtualbackpackCargo;

Share this post


Link to post
Share on other sites
Guest

The whitelisting function is real crap. Try to whitelist client side each time he opens the arsenal. For exemple, you can't whitelist FirstAidKits after the first whitelisting.

Share this post


Link to post
Share on other sites

one thing worth noting with the system that i posted, is that if a unit is carrying an item then it will show up in the arsenal also.

E.G. u havent whitelisted ACE_morphine, but if he is carrying 1 stick of it then opens the arsenal box then he can take as many morphine as he wants.

The 'fixed arsenal' mod fixes stuff like that if needed, i think.

Also if a unit is carrying any item that is not whitelisted, he will not be able to save and load his kit.

Share this post


Link to post
Share on other sites
Guest

one thing worth noting with the system that i posted, is that if a unit is carrying an item then it will show up in the arsenal also.

E.G. u havent whitelisted ACE_morphine, but if he is carrying 1 stick of it then opens the arsenal box then he can take as many morphine as he wants.

The 'fixed arsenal' mod fixes stuff like that if needed, i think.

Also if a unit is carrying any item that is not whitelisted, he will not be able to save and load his kit.

 

He will not be able to load it if he does not have the item anymore.

Share this post


Link to post
Share on other sites

Bit of self-advertising: @XLA_FixedArsenal which adds a few fixes & features my community ended up needing to really make the arsenal work for us:

 

  • Partial loading of loadouts: Even when some items are unavailable (e.g. mod not loaded/item not currently allowed) you can still access all loadouts (only available&allowed components will be loaded)
  • Way better performance: The system can be significantly faster, especially for large whitelists and large modsets with plenty of weapons/items.
  • Option to disable the 'feature' that makes current player gear replicable in the arsenal even if it's not on the current whitelist.
  • Blacklisting: No more need to list all "allowed" items, you can now also provide a list of forbidden items (might sometimes be significantly shorter, e.g. removing all thermal scopes)
  • Support for force-replacing equipment: Supply an old_classname and a new_classname and the system will replace each occurrence of old_classname in the players loadout with new_classname.  (Happens on opening arsenal & on loading outfits). Originally developed as a workaround for TFAR's duplicate radio ID issues, this can also be used to e.g. automatically fix people using the wrong kind of UAV tablet (wrong faction).

Usage is probably best explained by looking at the header of xla_fnc_arsenal, all options are listed there. The mod still behaves like the vanilla arsenal in most ways so switching over is not very complicated. Mostly just replacing "bis_fnc_arsenal" with "xla_fnc_arsenal" in your ammobox script and, if you want to use some of the optional features, adding a few (optional) params to the call.

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
Sign in to follow this  

×