//==========================================//
//					    //
//	  Do not edit this file		    //
//					    //
//==========================================//


if (isNull player) exitwith {};

//sleep 10;

if ammo_resupply then
{
	supply_counter = resupply_time * 60;
	sleep 1;

	if resupply_b1 then
	{
		if not (resupply_script_b1) then
		{
			sleep 0.1;
			resupply_script_b1 = true;
			resupply_b1 = false;
			sleep supply_counter;
			headquarters sidechat format ["%1 is currently being Resupplied...", bat_menu1];
			sleep 15;
			resupply_script_b1 = false;

			b1_he_ammo_current = b1_he_ammo;
			b1_illum_ammo_current = b1_illum_ammo;
			b1_wp_ammo_current = b1_wp_ammo;
			b1_sadarm_ammo_current = b1_sadarm_ammo;
			b1_smoke_ammo_current = b1_smoke_ammo;
			b1_laser_ammo_current = b1_laser_ammo;

			headquarters sidechat format ["%1 has been resupplied", bat_menu1];
		};
	};

	if resupply_b2 then
	{
		if not (resupply_script_b2) then
		{
			sleep 0.1;
			resupply_script_b2 = true;
			resupply_b2 = false;
			sleep supply_counter;
			headquarters sidechat format ["%1 is currently being Resupplied...", bat_menu2];
			sleep 15;
			resupply_script_b2 = false;

			b2_he_ammo_current = b2_he_ammo;
			b2_illum_ammo_current = b2_illum_ammo;
			b2_wp_ammo_current = b2_wp_ammo;
			b2_sadarm_ammo_current = b2_sadarm_ammo;
			b2_smoke_ammo_current = b2_smoke_ammo;
			b2_laser_ammo_current = b2_laser_ammo;

			headquarters sidechat format ["%1 has been resupplied", bat_menu2];
		};
	};

	if resupply_b3 then
	{
		if not (resupply_script_b3) then
		{
			sleep 0.1;
			resupply_script_b3 = true;
			resupply_b3 = false;
			sleep supply_counter;
			headquarters sidechat format ["%1 is currently being Resupplied...", bat_menu3];
			sleep 15;
			resupply_script_b3 = false;

			b3_he_ammo_current = b3_he_ammo;
			b3_illum_ammo_current = b3_illum_ammo;
			b3_wp_ammo_current = b3_wp_ammo;
			b3_sadarm_ammo_current = b3_sadarm_ammo;
			b3_smoke_ammo_current = b3_smoke_ammo;
			b3_laser_ammo_current = b3_laser_ammo;

			headquarters sidechat format ["%1 has been resupplied", bat_menu3];
		};
	};
};