Jump to content
Sign in to follow this  
ZZEZ

Getting the script to only run once?

Recommended Posts

Its puzzling, basically I added ammobox to insurgency.

It appears whenever players[JIPs] join the ammobox script gets run for all the players..but the ammobox is local so I am confused why its doing that and how do I fix that?

ammobox1 = "BAF_VehicleBox" createVehicleLocal getpos vehicleServicePoint;
VSPdir = getDir vehicleServicePoint;
ammobox1 setPos (vehicleServicePoint modelToWorld [0,-10,0]);
ObjectHgt = getPosATL ammobox1;
TerrainCorrection = (ObjectHgt select 2);
ammobox1 setPos (vehicleServicePoint modelToWorld [0,-7,-TerrainCorrection]);
ammobox1 setDir (VSPdir - 0);
ammobox1 lock false;
ammobox1 setVehicleLock "UNLOCKED";
ammobox1 setVehicleInit "ammobox1 execVM ""client\FillAmmoBox.sqf""";
processInitCommands;

Everyone run that once, but it seems that JIPs causing it to run again for everyone?

Heres the ammobox script

//................................
//	Fill Ammo Box Script by Lzryde (v0.2)
//................................

// Settings
_amountWeapon = 1;
_amountAmmo = 15;
_amountammoMag = 1;
_refreshTime = 1200; // refill every 20 minutes

ammobox1 allowDamage false;

// Loop forever
while {true} do
{

// Clear box
clearWeaponCargo _this;
clearMagazineCargo _this;

// Fill box

//hawkeye's stuff
_this addWeaponCargo ["ACE_ParachutePack",24];
_this addWeaponCargo ["ACE_ParachuteRoundPack",6];
_this addMagazineCargo ["ACE_VS17Panel_M",6];
_this addMagazineCargo ["ACE_Rope_M_50",6];
_this addMagazineCargo ["ACE_Rope_M_60",6];
_this addMagazineCargo ["ACE_Rope_M_90",6];
_this addMagazineCargo ["ACE_Rope_M_120",6];
_this addMagazineCargo ["ACE_Rope_M5",6]; // Sling


//soflam
               _this addWeaponCargo ["Laserdesignator", _amountWeapon];
               _this addMagazineCargo ["Laserbatteries", _amountammoMag];
//shottys
	    _this addWeaponCargo ["M1014", _amountWeapon];
               _this addWeaponCargo ["AA12_PMC", _amountWeapon];
               _this addWeaponCargo ["Saiga12K", _amountWeapon];
//M14 godmod
	    _this addWeaponCargo ["M14_EP1", _amountWeapon];
	    _this addWeaponCargo ["ACE_M14_ACOG", _amountWeapon];
//AR15
          _this addWeaponCargo ["M16A2", _amountWeapon];
	    _this addWeaponCargo ["ACE_m16a2_scope", _amountWeapon];
	    _this addWeaponCargo ["M16A2GL", _amountWeapon];
               _this addWeaponCargo ["ACE_m16a2gl_scope", _amountWeapon];
               _this addWeaponCargo ["ACE_M16A4_Iron", _amountWeapon];
               _this addWeaponCargo ["ACE_M16A4_CCO_GL", _amountWeapon];
               _this addWeaponCargo ["ACE_M16A4_ACG_GL_UP", _amountWeapon];
	    _this addWeaponCargo ["ACE_M4A1_Eotech", _amountWeapon];
	    _this addWeaponCargo ["ACE_M4A1_GL", _amountWeapon];
	    _this addWeaponCargo ["ACE_M4A1_ACOG", _amountWeapon];
               _this addWeaponCargo ["ACE_SOC_M4A1", _amountWeapon];
               _this addWeaponCargo ["ACE_SOC_M4A1_Aim", _amountWeapon];
               _this addWeaponCargo ["ACE_SOC_M4A1_Eotech", _amountWeapon];
               _this addWeaponCargo ["ACE_SOC_M4A1_Eotech_4x", _amountWeapon];
               _this addWeaponCargo ["ACE_SOC_M4A1_GL", _amountWeapon];
               _this addWeaponCargo ["ACE_SOC_M4A1_GL_13", _amountWeapon];
               _this addWeaponCargo ["ACE_SOC_M4A1_GL_AIMPOINT", _amountWeapon];
               _this addWeaponCargo ["ACE_SOC_M4A1_GL_EOTECH", _amountWeapon];
               _this addWeaponCargo ["ACE_SOC_M4A1_SHORTDOT", _amountWeapon];
               _this addWeaponCargo ["M4A3_CCO_EP1", _amountWeapon];
               _this addWeaponCargo ["M4A3_RCO_GL_EP1", _amountWeapon];
//HK family
               _this addWeaponCargo ["ACE_HK416_D14_COMPM3", _amountWeapon];
               _this addWeaponCargo ["ACE_HK416_D14_COMPM3_M320", _amountWeapon];
               _this addWeaponCargo ["ACE_HK417_micro", _amountWeapon];
               _this addWeaponCargo ["ACE_HK417_Eotech_4x", _amountWeapon];
               _this addWeaponCargo ["ACE_HK417_leupold", _amountWeapon];
               _this addWeaponCargo ["ACE_HK417_Shortdot", _amountWeapon];
//SCAR family
          _this addWeaponCargo ["SCAR_L_CQC_EGLM_Holo", _amountWeapon];
               _this addWeaponCargo ["SCAR_L_STD_EGLM_RCO", _amountWeapon];
	    _this addWeaponCargo ["SCAR_L_CQC", _amountWeapon];
	    _this addWeaponCargo ["SCAR_L_CQC_Holo", _amountWeapon];
	    _this addWeaponCargo ["ACE_SCAR_H_STD_Spect", _amountWeapon];
               _this addWeaponCargo ["SCAR_H_STD_EGLM_Spect", _amountWeapon];
               _this addWeaponCargo ["SCAR_H_CQC_CCO", _amountWeapon];
               _this addWeaponCargo ["SCAR_H_STD_TWS_SD", _amountWeapon];
//L85 family
               _this addWeaponCargo ["BAF_L85A2_RIS_ACOG", _amountWeapon];
               _this addWeaponCargo ["BAF_L85A2_RIS_Holo", _amountWeapon];
               _this addWeaponCargo ["BAF_L85A2_RIS_SUSAT", _amountWeapon];
               _this addWeaponCargo ["BAF_L85A2_UGL_ACOG", _amountWeapon];
               _this addWeaponCargo ["BAF_L85A2_UGL_Holo", _amountWeapon];
               _this addWeaponCargo ["BAF_L85A2_UGL_SUSAT", _amountWeapon];
//G36 family
               _this addWeaponCargo ["G36a", _amountWeapon];
               _this addWeaponCargo ["G36a_camo", _amountWeapon];
               _this addWeaponCargo ["ACE_G36A1_AG36A1", _amountWeapon];
               _this addWeaponCargo ["ACE_G36A1_AG36A1_D", _amountWeapon];
               _this addWeaponCargo ["ACE_G36A2", _amountWeapon];
               _this addWeaponCargo ["ACE_G36A2_Bipod", _amountWeapon];
               _this addWeaponCargo ["ACE_G36A2_Bipod_D", _amountWeapon];
               _this addWeaponCargo ["ACE_G36A2_D", _amountWeapon];
               _this addWeaponCargo ["ACE_G36K_EOTech", _amountWeapon];
               _this addWeaponCargo ["ACE_G36K_EOTech_D", _amountWeapon];
               _this addWeaponCargo ["ACE_G36K_iron", _amountWeapon];
               _this addWeaponCargo ["ACE_G36K_iron_D", _amountWeapon];
//M8 family
               _this addWeaponCargo ["m8_carbine", _amountWeapon];
               _this addWeaponCargo ["m8_carbine_pmc", _amountWeapon];
               _this addWeaponCargo ["m8_carbineGL", _amountWeapon];
               _this addWeaponCargo ["m8_compact", _amountWeapon];
               _this addWeaponCargo ["m8_compact_pmc", _amountWeapon];
//Czech weapons
               _this addWeaponCargo ["Sa58P_EP1", _amountWeapon];
               _this addWeaponCargo ["Sa58V_CCO_EP1", _amountWeapon];
               _this addWeaponCargo ["Sa58V_EP1", _amountWeapon];
               _this addWeaponCargo ["Sa58V_RCO_EP1", _amountWeapon];
//G3 family
               _this addWeaponCargo ["ACE_G3A3_RSAS", _amountWeapon];
               _this addWeaponCargo ["ACE_G3A3", _amountWeapon];
               _this addWeaponCargo ["ACE_G3SG1", _amountWeapon]; 
//MGs
          _this addWeaponCargo ["ACE_M27_IAR", _amountWeapon];
          _this addWeaponCargo ["ACE_M27_IAR_ACOG", _amountWeapon];
          _this addWeaponCargo ["M240", _amountWeapon];
          _this addWeaponCargo ["m240_scoped_EP1", _amountWeapon];
          _this addWeaponCargo ["BAF_L7A2_GPMG", _amountWeapon];
          _this addWeaponCargo ["ACE_BAF_L7A2_GPMG", _amountWeapon];
	    _this addWeaponCargo ["M249_EP1", _amountWeapon];
          _this addWeaponCargo ["ACE_M249_PIP_ACOG", _amountWeapon];
          _this addWeaponCargo ["M60A4_EP1", _amountWeapon];
          _this addWeaponCargo ["Mk_48_DES_EP1", _amountWeapon];
          _this addWeaponCargo ["ACE_M60", _amountWeapon];
               _this addWeaponCargo ["PK", _amountWeapon];
               _this addWeaponCargo ["Pecheneg", _amountWeapon];
//Snipers and DMRs
               _this addWeaponCargo ["m8_sharpshooter", _amountWeapon];
               _this addWeaponCargo ["BAF_L86A2_ACOG", _amountWeapon];
               _this addWeaponCargo ["ACE_Mk12mod1", _amountWeapon];
	    _this addWeaponCargo ["DMR", _amountWeapon];
	    _this addWeaponCargo ["ACE_M110", _amountWeapon];
          _this addWeaponCargo ["M110_NVG_EP1", _amountWeapon];
               _this addWeaponCargo ["ACE_SVD_Bipod", _amountWeapon];
               _this addWeaponCargo ["VSS_vintorez", _amountWeapon];               
//MISC guns

               _this addWeaponCargo ["LeeEnfield", _amountWeapon];
               _this addWeaponCargo ["ACE_M3A1", _amountWeapon];
               _this addWeaponCargo ["ACE_oc14", _amountWeapon];
               _this addWeaponCargo ["ACE_oc14gl", _amountWeapon];
               _this addWeaponCargo ["ACE_oc14glsp", _amountWeapon];
               _this addWeaponCargo ["ACE_oc14sp", _amountWeapon];
               _this addWeaponCargo ["bizon", _amountWeapon];
               _this addWeaponCargo ["bizon_silenced", _amountWeapon];
               _this addWeaponCargo ["ACE_SKS", _amountWeapon];
               _this addWeaponCargo ["ACE_UMP45", _amountWeapon];
	    _this addWeaponCargo ["Javelin", _amountWeapon];
 	    _this addWeaponCargo ["ACE_M136_CSRS", _amountWeapon];
	    _this addWeaponCargo ["ACE_M72A2", _amountWeapon];
               _this addWeaponCargo ["M47Launcher_EP1", _amountWeapon];
          _this addWeaponCargo ["MAAWS", _amountWeapon];
	    _this addWeaponCargo ["SMAW", _amountWeapon];
               _this addWeaponCargo ["ACE_RPG7V_PGO7", _amountWeapon];
               _this addWeaponCargo ["ACE_RPG29", _amountWeapon];
               _this addWeaponCargo ["ACRE_PRC117F", _amountWeapon];
               _this addWeaponCargo ["ACE_PRC119", _amountWeapon];
               _this addWeaponCargo ["ACE_CharliePack", _amountWeapon];
               _this addWeaponCargo ["ACE_CharliePack_ACU", _amountWeapon];
               _this addWeaponCargo ["ACE_CharliePack_WMARPAT", _amountWeapon];
               _this addWeaponCargo ["ACE_CharliePack_ACU_Medic", _amountWeapon];
//pistols
		_this addWeaponCargo ["Colt1911", _amountWeapon];
		_this addWeaponCargo ["M9", _amountWeapon];
		_this addWeaponCargo ["ACE_P226", _amountWeapon];


 //MISC amountAmmo       
           _this addMagazineCargo ["ACE_Bandage", _amountAmmo];
           _this addMagazineCargo ["ACE_Morphine", _amountAmmo];
           _this addMagazineCargo ["ACE_Epinephrine", _amountAmmo];
           _this addMagazineCargo ["ACE_Medkit", _amountAmmo];
           _this addWeaponCargo ["acre_prc148", _amountWeapon];
           _this addMagazineCargo ["ACE_Knicklicht_B", _amountAmmo];
           _this addMagazineCargo ["ACE_Knicklicht_G", _amountAmmo];
           _this addMagazineCargo ["ACE_Knicklicht_IR", _amountAmmo];
           _this addMagazineCargo ["ACE_Knicklicht_R", _amountAmmo];
           _this addMagazineCargo ["ACE_Knicklicht_W", _amountAmmo];
           _this addMagazineCargo ["ACE_Knicklicht_Y", _amountAmmo];
	_this addMagazineCargo ["ACE_1Rnd_HE_M203", _amountAmmo];
	_this addMagazineCargo ["1Rnd_HE_M203", _amountAmmo];
	_this addMagazineCargo ["FlareWhite_M203", _amountAmmo];
	_this addMagazineCargo ["FlareGreen_M203", _amountAmmo];
	_this addMagazineCargo ["FlareRed_M203", _amountAmmo];
	_this addMagazineCargo ["FlareYellow_M203", _amountAmmo];
	_this addMagazineCargo ["ACE_FlareIR_M203", _amountAmmo];
	_this addMagazineCargo ["ACE_SSWhite_M203", _amountAmmo];
	_this addMagazineCargo ["ACE_SSYellow_M203", _amountAmmo];
	_this addMagazineCargo ["ACE_SSGreen_M203", _amountAmmo];
	_this addMagazineCargo ["ACE_SSRed_M203", _amountAmmo];
	_this addMagazineCargo ["1Rnd_Smoke_M203", _amountAmmo];
	_this addMagazineCargo ["1Rnd_SmokeRed_M203", _amountAmmo];
	_this addMagazineCargo ["1Rnd_SmokeGreen_M203", _amountAmmo];
	_this addMagazineCargo ["1Rnd_SmokeYellow_M203", _amountAmmo];
           _this addMagazineCargo ["1Rnd_HE_GP25", _amountAmmo];
           _this addMagazineCargo ["1Rnd_SMOKE_GP25", _amountAmmo];
	_this addMagazineCargo ["HandGrenade_West", _amountAmmo];
	_this addMagazineCargo ["IR_Strobe_Marker", _amountAmmoMag];
	_this addMagazineCargo ["IR_Strobe_Target", _amountAmmoMag];
	_this addMagazineCargo ["ACE_M34", _amountAmmo];
	_this addMagazineCargo ["ACE_M84", _amountAmmo];
	_this addMagazineCargo ["Mine", _amountAmmo];
	_this addMagazineCargo ["PipeBomb", _amountAmmo];
	_this addMagazineCargo ["SmokeShell", _amountAmmo];
	_this addMagazineCargo ["SmokeShellBlue", _amountAmmo];
	_this addMagazineCargo ["SmokeShellGreen", _amountAmmo];
	_this addMagazineCargo ["SmokeShellOrange", _amountAmmo];
	_this addMagazineCargo ["SmokeShellPurple", _amountAmmo];
	_this addMagazineCargo ["SmokeShellRed", _amountAmmo];
	_this addMagazineCargo ["SmokeShellYellow", _amountAmmo];
	_this addWeaponCargo ["ACE_GlassesSunglasses", _amountAmmoMag];
	_this addWeaponCargo ["ACE_GlassesBalaklava", _amountAmmoMag];
	_this addWeaponCargo ["ACE_GlassesBalaklavaGray", _amountAmmoMag];
	_this addWeaponCargo ["ACE_GlassesBalaklavaOlive", _amountAmmoMag];
	_this addWeaponCargo ["Binocular", _amountAmmoMag];
	_this addWeaponCargo ["ItemCompass", _amountAmmoMag];
	_this addWeaponCargo ["ACE_DAGR", _amountAmmoMag];
	_this addWeaponCargo ["ACE_Earplugs", _amountAmmoMag];
	_this addWeaponCargo ["ItemGPS", _amountAmmoMag];
	_this addWeaponCargo ["ACE_HuntIR_monitor", _amountAmmoMag];
	_this addWeaponCargo ["ACE_Kestrel4500", _amountAmmoMag];
	_this addWeaponCargo ["ItemMap", _amountAmmoMag];
	_this addWeaponCargo ["NVGoggles", _amountAmmoMag];
	_this addWeaponCargo ["ItemRadio", _amountAmmoMag];
	_this addMagazineCargo ["ACE_Rope_M_120", _amountAmmo];
	_this addWeaponCargo ["ACE_GlassesLHD_glasses", _amountAmmoMag];
	_this addWeaponCargo ["ACE_SpottingScope", _amountAmmoMag];
	_this addWeaponCargo ["ACE_Rangefinder_OD", _amountAmmoMag];
	_this addWeaponCargo ["ItemWatch", _amountAmmoMag];

	//MAGS amountAmmoMag
_this addMagazineCargo ["ACE_10Rnd_127x99_Raufoss_m107", _amountAmmo];
_this addMagazineCargo ["ACE_10Rnd_127x99_T_m107", _amountAmmo];
_this addMagazineCargo ["ACE_100Rnd_556x45_T_M249", _amountAmmo];
_this addMagazineCargo ["ACE_200Rnd_556x45_T_M249", _amountAmmo];
_this addMagazineCargo ["ACE_30Rnd_556x45_SB_S_Stanag", _amountAmmo];
_this addMagazineCargo ["ACE_30Rnd_556x45_SB_Stanag", _amountAmmo];
_this addMagazineCargo ["ACE_30Rnd_556x45_T_Stanag", _amountAmmo];
_this addMagazineCargo ["20Rnd_556x45_Stanag", _amountAmmo];
_this addMagazineCargo ["ACE_5Rnd_127x99_B_TAC50", _amountAmmo];
_this addMagazineCargo ["ACE_5Rnd_127x99_S_TAC50", _amountAmmo];
_this addMagazineCargo ["ACE_5Rnd_127x99_T_TAC50", _amountAmmo];
_this addMagazineCargo ["ACE_20Rnd_762x51_S_M110", _amountAmmo];
_this addMagazineCargo ["ACE_20Rnd_762x51_SB_M110", _amountAmmo];
_this addMagazineCargo ["ACE_20Rnd_762x51_T_M110", _amountAmmo];
_this addMagazineCargo ["ACE_15Rnd_9x19_P226", _amountAmmo];
_this addMagazineCargo ["15Rnd_9x19_M9", _amountAmmo];
_this addMagazineCargo ["20Rnd_762x51_DMR", _amountAmmo];
_this addMagazineCargo ["ACE_20Rnd_762x51_B_M14", _amountAmmo];
_this addMagazineCargo ["ACE_20Rnd_762x51_T_DMR", _amountAmmo];
_this addMagazineCargo ["10x_303", _amountAmmo];
_this addMagazineCargo ["5rnd_127x99_as50", _amountAmmo];
_this addMagazineCargo ["10Rnd_127x99_m107", _amountAmmo];
_this addMagazineCargo ["200Rnd_556x45_L110A1", _amountAmmo];
_this addMagazineCargo ["5Rnd_86x70_L115A1", _amountAmmo];
_this addMagazineCargo ["100Rnd_762x54_PK", _amountAmmo];
_this addMagazineCargo ["10Rnd_762x54_SVD", _amountAmmo];
_this addMagazineCargo ["8Rnd_9x18_Makarov", _amountAmmo];
_this addMagazineCargo ["6Rnd_45ACP", _amountAmmo];
_this addMagazineCargo ["20Rnd_B_765x17_Ball", _amountAmmo];
_this addMagazineCargo ["30Rnd_9x19_UZI", _amountAmmo];
_this addMagazineCargo ["PG7V", _amountAmmo];
_this addMagazineCargo ["PG7VL", _amountAmmo];
_this addMagazineCargo ["PG7VR", _amountAmmo];
_this addMagazineCargo ["OG7", _amountAmmo];
_this addMagazineCargo ["Strela", _amountAmmo];
_this addMagazineCargo ["20Rnd_762x51_FNFAL", _amountAmmo];
_this addMagazineCargo ["30Rnd_762x39_AK47", _amountAmmo];
_this addMagazineCargo ["30Rnd_556x45_Stanag", _amountAmmo];
_this addMagazineCargo ["5Rnd_762x51_M24", _amountAmmo];
_this addMagazineCargo ["ACE_5Rnd_762x51_T_M24", _amountAmmo];
_this addMagazineCargo ["100Rnd_762x51_M240", _amountAmmo];
_this addMagazineCargo ["100Rnd_556x45_M249", _amountAmmo];
_this addMagazineCargo ["200Rnd_556x45_M249", _amountAmmo];
_this addMagazineCargo ["20Rnd_762x51_B_SCAR", _amountAmmo];
_this addMagazineCargo ["20rnd_762x51_B_SCAR", _amountAmmo];
_this addMagazineCargo ["8Rnd_B_Beneli_Pellets", _amountAmmo];
_this addMagazineCargo ["Javelin", _amountAmmo];
_this addMagazineCargo ["ACE_Javelin_Direct", _amountAmmo];
_this addMagazineCargo ["Mine", _amountAmmo];
_this addMagazineCargo ["PipeBomb", _amountAmmo];
_this addMagazineCargo ["15Rnd_9x19_M9", _amountAmmo];
_this addMagazineCargo ["7Rnd_45ACP_1911", _amountAmmo];
_this addMagazineCargo ["17Rnd_9x19_glock17", _amountAmmo];
_this addMagazineCargo ["ACE_15Rnd_9x19_P226", _amountAmmo];
_this addMagazineCargo ["HandGrenade_West", _amountAmmo];
_this addMagazineCargo ["HandGrenade_East", _amountAmmo];
_this addMagazineCargo ["SmokeShell", _amountAmmo];
_this addMagazineCargo ["1Rnd_HE_M203", _amountAmmo];
_this addMagazineCargo ["1Rnd_Smoke_M203", _amountAmmo];
_this addMagazineCargo ["IR_Strobe_Target", _amountAmmoMag];
_this addMagazineCargo ["IR_Strobe_Marker", _amountAmmoMag];
_this addMagazineCargo ["FlareWhite_M203", _amountAmmo];
_this addMagazineCargo ["FlareYellow_M203", _amountAmmo];
_this addMagazineCargo ["FlareGreen_M203", _amountAmmo];
_this addMagazineCargo ["FlareRed_M203", _amountAmmo];
_this addMagazineCargo ["1Rnd_SmokeRed_M203", _amountAmmo];
_this addMagazineCargo ["1Rnd_SmokeGreen_M203", _amountAmmo];
_this addMagazineCargo ["1Rnd_SmokeYellow_M203", _amountAmmo];
_this addMagazineCargo ["1Rnd_HE_GP25", _amountAmmo];
_this addMagazineCargo ["FlareWhite_GP25", _amountAmmo];
_this addMagazineCargo ["FlareGreen_GP25", _amountAmmo];
_this addMagazineCargo ["FlareRed_GP25", _amountAmmo];
_this addMagazineCargo ["FlareYellow_GP25", _amountAmmo];
_this addMagazineCargo ["1Rnd_Smoke_GP25", _amountAmmo];
_this addMagazineCargo ["1Rnd_SmokeRed_GP25", _amountAmmo];
_this addMagazineCargo ["1Rnd_SmokeGreen_GP25", _amountAmmo];
_this addMagazineCargo ["1Rnd_SmokeYellow_GP25", _amountAmmo];
_this addMagazineCargo ["Laserbatteries", _amountAmmo];
_this addMagazineCargo ["ACE_Battery_Rangefinder", _amountAmmo];
_this addMagazineCargo ["ACE_Flashbang", _amountAmmo];
_this addMagazineCargo ["ACE_SSGreen_M203", _amountAmmo];
_this addMagazineCargo ["ACE_SSRed_M203", _amountAmmo];
_this addMagazineCargo ["ACE_SSWhite_M203", _amountAmmo];
_this addMagazineCargo ["ACE_20Rnd_762x51_SB_SCAR", _amountAmmo];
_this addMagazineCargo ["ACE_SSYellow_M203", _amountAmmo];
_this addMagazineCargo ["ACE_FlareIR_M203", _amountAmmo];
_this addMagazineCargo ["ACE_HuntIR_M203", _amountAmmo];
_this addMagazineCargo ["ACE_1Rnd_HE_M203", _amountAmmo];
_this addMagazineCargo ["ACE_M34", _amountAmmo];
_this addMagazineCargo ["BAF_L109A1_HE", _amountAmmo];
_this addMagazineCargo ["ACE_M84", _amountAmmo];
_this addMagazineCargo ["ACE_Claymore_M", _amountAmmo];
_this addMagazineCargo ["ACE_C4_M", _amountAmmo];
_this addMagazineCargo ["ACE_Rope_M_120", _amountAmmo];
_this addMagazineCargo ["ACE_MAAWS_HE", _amountAmmo];
_this addMagazineCargo ["MAAWS_HEAT", _amountAmmo];
_this addMagazineCargo ["MAAWS_HEDP", _amountAmmo];
_this addMagazineCargo ["ACE_SMAW_NE", _amountAmmo];
_this addMagazineCargo ["ACE_25Rnd_1143x23_B_UMP45", _amountAmmo];
_this addMagazineCargo ["ACE_10Rnd_762x39_B_SKS", _amountAmmo];
_this addMagazineCargo ["64Rnd_9x19_Bizon", _amountAmmo];
_this addMagazineCargo ["64Rnd_9x19_SD_Bizon", _amountAmmo];
_this addMagazineCargo ["ACE_64Rnd_9x19_S_Bizon", _amountAmmo];
_this addMagazineCargo ["10Rnd_9x39_SP5_VSS", _amountAmmo];
_this addMagazineCargo ["20Rnd_9x39_SP5_VSS", _amountAmmo];
_this addMagazineCargo ["ACE_20Rnd_9x39_B_OC14", _amountAmmo];
_this addMagazineCargo ["ACE_20Rnd_9x39_S_OC14", _amountAmmo];
_this addMagazineCargo ["ACE_30Rnd_1143x23_B_M3", _amountAmmo];
_this addMagazineCargo ["20Rnd_B_AA12_74Slug", _amountAmmo];
_this addMagazineCargo ["20Rnd_B_AA12_HE", _amountAmmo];
_this addMagazineCargo ["20Rnd_B_AA12_Pellets", _amountAmmo];
_this addMagazineCargo ["8Rnd_B_Saiga12_74Slug", _amountAmmo];
_this addMagazineCargo ["8Rnd_B_Saiga12_Pellets", _amountAmmo];
_this addMagazineCargo ["ACE_8Rnd_12Ga_Buck00_Saiga12", _amountAmmo];
_this addMagazineCargo ["ACE_20Rnd_762x51_T_HK417", _amountAmmo];
_this addMagazineCargo ["ACE_20Rnd_762x51_B_HK417", _amountAmmo];
_this addMagazineCargo ["ACE_20Rnd_762x51_SB_HK417", _amountAmmo];
_this addMagazineCargo ["ACE_20Rnd_762x51_T_G3", _amountAmmo];
_this addMagazineCargo ["ACE_20Rnd_762x51_B_G3", _amountAmmo];
_this addMagazineCargo ["1Rnd_SMOKE_GP25", _amountAmmo];
_this addMagazineCargo ["1Rnd_HE_GP25", _amountAmmo];
_this addMagazineCargo ["SMAW_HEAA", _amountAmmo];
_this addMagazineCargo ["ACE_RPG29_TBG29", _amountAmmo];
_this addMagazineCargo ["ACE_8Rnd_762x25_B_Tokarev", _amountAmmo];
_this addMagazineCargo ["ACE_RPG29_PG29", _amountAmmo];
_this addMagazineCargo ["Dragon_EP1", _amountAmmo];
_this addMagazineCargo ["SMAW_HEDP", _amountAmmo];
_this addMagazineCargo ["30Rnd_545x39_AK", _amountAmmo];
_this addMagazineCargo ["75Rnd_545x39_RPK", _amountAmmo];
_this addMagazineCargo ["30Rnd_556x45_G36", _amountAmmo];
_this addMagazineCargo ["ACE_30Rnd_762x39_T_SA58", _amountAmmo];
_this addMagazineCargo ["30Rnd_762x39_SA58", _amountAmmo];
_this addMagazineCargo ["ACE_SMAW_Spotting", _amountAmmo];
// Wait the duration of _refreshTime
sleep _refreshTime;
};

Edited by ZZEZ

Share this post


Link to post
Share on other sites

just replace the:

ammobox1 setVehicleInit "ammobox1 execVM ""client\FillAmmoBox.sqf""";
processInitCommands;

with

ammobox1 execVM "client\FillAmmoBox.sqf";

there is no need to set that on the init O_o, its a total nonsense to use setvehicleinit there, it should be avoided when posible to avoid posible JIP problems.

The weapons are readded because the "processInitCommands;" re-executes all the inits lines of the vehicles on all clients, because its a global script command, so thats basically your problem.

Edited by columdrum

Share this post


Link to post
Share on other sites

Aha, thanks...just tested it and no more JIP doing it for us

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  

×