Jump to content
Razor[42JTF]

Virtual Arsenal Issue - Automatic Ammo

Recommended Posts

Hi All

 

Was wondering if there was a way to stop the virtual arsenal from automatically assigning ammunition to a player when chosing a new rifle.

 

I want to white list certain items and because we are using a few mods, not all 5.56mm ammo can be shared across all rifles. The only type that can be shared is the standard bohemia 5.56mm ammo.

 

However if you chose for example an RHS M16A4, the virtual arsenal will give you mk318 5.56 30 rnd ammo for that rifle even if you havent white listed that ammunition. 

 

 

This is causing issues when saving and loading loadouts as only the bohemia ammo is white listed.

 

My Code:

//Init stuff
_crate = _this select 0;
["AmmoboxInit",[_crate,false,{true}]] spawn BIS_fnc_arsenal;

//Lists of items to include

_availableHeadgear = [
	//Armour
	"H_HelmetCrew_I",
	//Aviation
	"H_CrewHelmetHeli_B",
	"H_PilotHelmetHeli_B",
	"MNP_Helmet_STPilot",
	//Delta
	//Infantry
	"42nd_Recruit_Beret",
	"MNP_Helmet_Scorpion"
	//Recon
];

_availableGoggles = [
	"G_Aviator",
	"rhs_googles_black",
	"rhs_googles_clear",
	"rhs_ess_black",
	"G_Squares_Tinted",
	"G_Bandanna_beast",
	"G_Bandanna_aviator",
	"G_Bandanna_blk",
	"G_Bandanna_oli",
	"TRYK_kio_balaclavas",
	"TRYK_kio_balaclava_WH",
	"TRYK_Beard_BK",
	"TRYK_Beard",
	"TRYK_Beard_BW",
	"TRYK_Beard_Gr",
	"TRYK_Beard_BK2",
	"TRYK_Beard2",
	"TRYK_Beard_BW2",
	"TRYK_Beard_Gr2",
	"TRYK_Beard_BK3",
	"TRYK_Beard3",
	"TRYK_Beard_BW3",
	"TRYK_Beard_Gr3",
	"TRYK_Beard_BK4",
	"TRYK_Beard4",
	"TRYK_Beard_BW4",
	"TRYK_Beard_Gr4",
	"TRYK_US_ESS_Glasses",
	"TRYK_US_ESS_Glasses_TAN_BLK",
	"TRYK_US_ESS_Glasses_BLK",
	"TRYK_US_ESS_Glasses_TAN",
	"TRYK_US_ESS_Glasses_WH",
	"TRYK_H_ghillie_top_headless3glass",
	"TRYK_Shemagh_mesh",
	"TRYK_Shemagh_G",
	"TRYK_Shemagh",
	"TRYK_Shemagh_WH",
	"TRYK_Shemagh_ESS",
	"TRYK_Shemagh_ESS_WH",
	"TRYK_SpsetG_Glasses",
	"TRYK_SPGEAR_Glasses",
	"TRYK_Spset_PHC1_Glasses",
	"TRYK_Spset_PHC2_Glasses"
];

_availableUniforms = [
	//Armour
	"42nd_od_02",
	//Aviation
	"42nd_multicam_gry",
	//Delta
	//Infantry
	"42nd_multicam_uniform",
	"42nd_multicam_uniform_02"
	//Recon
];

_availableVests = [
	//Armour
	"MNP_Vest_Light_R3",
	//Aviation
	"42nd_bgry_vest_kerry",
	//Delta
	//Infantry
	"42nd_od_vest_plate",
	//EOD
	"42nd_od_vest_kerry"
	//Recon
];

_availableItems = [
	
	//Misc
	"ACE_CableTie",
	"ACE_EarPlugs",
	"ACE_key_west",
	"ACE_Flashlight_XL50",
	"ACE_MapTools",
	"Laserbatteries",
	"ToolKit",
	"ACE_RangeTable_82mm",
	"ACE_Clacker",
	"ACE_DefusalKit",
	"ACE_IR_Strobe_Item",
	"ACE_wirecutter",
	"MineDetector",
	"ACE_Banana",
	"ACE_HuntIR_monitor",
	//-----------------------
	
	//Medical
	"ACE_packingBandage",
	"ACE_morphine",
	"ACE_epinephrine",
	"ACE_bloodIV",
	"ACE_bloodIV_500",
	"ACE_bloodIV_250",
	"ACE_bodyBag",
	//-----------------------
	
	//Equipment
	"ItemMap",
	"ItemCompass",
	"tf_microdagr",
	"ItemGPS",
	"tf_anprc152",
	"ACE_NVG_Gen4",
	"rhsusf_ANPVS_15",
	"rhs_weap_rsp30_white",
	"rhs_weap_rsp30_green",
	"rhs_weap_rsp30_red",
	//-----------------------
	
	//WeaponAttachments
	"RH_SFM952V",
	"RH_fa556",
	"rhsusf_acc_harris_bipod",
	//Scope
	"optic_Hamr",
	"RH_eotech553",
	"RH_m145",
	"optic_ACO_grn",
	"optic_Aco",
	"RH_compM2",
	"rhsusf_acc_eotech_552",
	"rhsusf_acc_compm4",
	"optic_Arco",
	"RH_compM2",
	"optic_Yorris",
	
	//Launcher attachments
	"rhs_weap_optic_smaw"
	//-----------------------
];

_availableBackpacks = [
	"B_Kitbag_rgr",
	"tf_rt1523g_big_bwmod",
	"tf_rt1523g_bwmod",
	"TRYK_B_Medbag_OD",
	"I_Mortar_01_weapon_F",
	"I_Mortar_01_support_F"
];

_availableMags = [
	//Explsoives
	"DemoCharge_Remote_Mag",
	"SatchelCharge_Remote_Mag",
	//Grenades
	"HandGrenade",
	"SmokeShell",
	"SmokeShellGreen",
	"SmokeShellYellow",
	"SmokeShellRed",
	"SmokeShellBlue",
	"B_IR_Grenade",
	"ACE_M84",
	"Chemlight_green",
	"Chemlight_red",
	"Chemlight_yellow",
	"Chemlight_blue",
	"ACE_HandFlare_White",
	"ACE_HandFlare_Red",
	"ACE_HandFlare_Green",
	//-----------------------
		
	//Ammo
	"30Rnd_556x45_Stanag",
	"30Rnd_556x45_Stanag_Tracer_Yellow",
	"30Rnd_556x45_Stanag_Tracer_Green",
	"30Rnd_556x45_Stanag_Tracer_Red",
	
	"6Rnd_45ACP_Cylinder",
	"9Rnd_45ACP_Mag",
	"11Rnd_45ACP_Mag",
	"rhsusf_mag_17Rnd_9x19_JHP",
	"rhsusf_mag_7x45acp_MHP",
	"rhsusf_mag_15Rnd_9x19_JHP",
	"16Rnd_9x21_Mag",
	
	"1Rnd_HE_Grenade_shell",
	"1Rnd_SmokeRed_Grenade_shell",
	"1Rnd_SmokeYellow_Grenade_shell",
	"1Rnd_SmokeGreen_Grenade_shell",
	"1Rnd_SmokePurple_Grenade_shell",
	"1Rnd_SmokeBlue_Grenade_shell",
	"1Rnd_SmokeOrange_Grenade_shell",
	"1Rnd_Smoke_Grenade_shell",
	"ACE_HuntIR_M203",
	
	"rhs_200rnd_556x45_T_SAW",
	"rhsusf_100Rnd_762x51_m62_tracer",
	
	"Titan_AA",
	"rhs_mag_smaw_HEAA",
	"rhs_mag_smaw_SR",
	"Titan_AT"
	//-----------------------
];


_availableWeapons = [
	
	//Pistol
	"hgun_Pistol_heavy_02_F",
	"hgun_ACPC2_F",
	"hgun_Pistol_heavy_01_F",
	"rhsusf_weap_glock17g4",
	"rhsusf_weap_m1911a1",
	"rhsusf_weap_m9",
	"hgun_Rook40_F",
	"hgun_P07_F",
	"rhs_weap_rsp30_white",
	"rhs_weap_rsp30_green",
	"rhs_weap_rsp30_red",
	//------------------------
	
	//Rifles
	//------------------------
	//M16A4
	"rhs_weap_m16a4_carryhandle_grip_pmag",
	"rhs_weap_m16a4_carryhandle_M203",
	"rhs_weap_m16a4_carryhandle_pmag",
	//M4A1
	"rhs_weap_m4a1_carryhandle_pmag",
	"rhs_weap_m4a1_carryhandle_grip2",
	"rhs_weap_m4a1_carryhandle_grip",
	"rhs_weap_m4a1_carryhandle_m203",
	"rhs_weap_m4a1_carryhandle_m203S",
	"rhs_weap_m4a1_m320",
	//Automatic Rifles
	"rhs_weap_m249_pip_L",
	"rhs_weap_m240B",
	//Launchers
	"launch_B_Titan_F",
	"launch_I_Titan_short_F",
	"rhs_weap_smaw",
	"tf47_at4_HEDP",
	//------------------------

	//Binocs
	"Binocular",
	"Laserdesignator",
	"ACE_Vector",
	"lerca_1200_black"
];

//Populate with predefined items and whatever is already in the crate
[_crate,(_availableBackpacks),true] call BIS_fnc_addVirtualBackpackCargo;
[_crate,(_availableHeadgear + _availableGoggles + _availableUniforms + _availableVests + _availableItems),true] call BIS_fnc_addVirtualItemCargo;
[_crate,_availableMags,true] call BIS_fnc_addVirtualMagazineCargo;
[_crate,(_availableWeapons),true] call BIS_fnc_addVirtualWeaponCargo;

I know I could just white list the mk318 RHS ammo but would prefer if I could disable the VA from giving it out if possible.  

 

I tried to use the following but it doesnt work as the mk318 ammo gets added once you pick the rifle, not when you call on the arsenal

[_crate,["rhs_mag_30Rnd_556x45_Mk318_Stanag"],true] call BIS_fnc_removeVirtualMagazineCargo;

Share this post


Link to post
Share on other sites

You cant at line 1608 in BIS_fnc_arsenal when a weapon is selected this is called...

[_center,_item,4] call bis_fnc_addweapon;

Where _center is the player using the arsenal, _item is the selected weapon and 4 automatically adds 4 base compatible mags.

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

×