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


if (isNull player) exitwith {};

player removeaction action1;
player removeaction action2;
player removeaction action3;
player removeaction action4;
player removeaction action5;
player removeaction action6;
player removeaction action7;
player removeaction action8;
player removeaction action9;
player removeaction action10;
player removeaction action11;

if battery_1 then
{
	if not (mission) then
	{
		target_b1 = false;
		deletemarkerlocal "arty_marker";

		sleep 0.1;

		_marker = createMarkerLocal ["arty_marker", [0,0]];
		sleep 0.1;
		arty_marker_t = "arty_marker";

		player onmapsingleclick "arty_marker_t setmarkerposlocal _pos; target_b1=true";

		[battery1, ammo_b1_c] call BIS_ARTY_F_LoadMapRanges;

		maxRange = battery1 getVariable "ARTY_MAX_RANGE";
		minRange = battery1 getVariable "ARTY_MIN_RANGE";

		[("max_range" setmarkerposlocal getpos battery_vehicle1),("max_range" setmarkersizelocal [maxrange,maxrange])];
		[("min_range" setmarkerposlocal getpos battery_vehicle1),("min_range" setmarkersizelocal [minRange,minRange])];

		hintsilent "Click on the Map to set the target";

		waituntil {target_b1};

		_marker setMarkerShapelocal "ICON";
		"arty_marker" setMarkerTypelocal "hd_destroy";
		"arty_marker" setMarkerColorlocal "Colorred";

		sleep 0.05;

		player onmapsingleclick "nil";

		"max_range" setmarkersizelocal [0,0];
		"max_range" setmarkerposlocal [0,0];
		"min_range" setmarkersizelocal [0,0];
		"min_range" setmarkerposlocal [0,0];

		hintsilent "Your target is marked";

		main_menu = [] execvm "artillery_ssp\menu\support.sqf";
		target_b1 = false;
	}
	else
	{
		hintsilent "Unable... Fire Mission in Progress";
		sleep 3;
		main_menu = [] execvm "artillery_ssp\menu\support.sqf";
	};
};


if battery_2 then
{
	if not (mission) then
	{
		target_b2 = false;
		deletemarkerlocal "arty_marker";

		sleep 0.1;

		_marker = createMarkerLocal ["arty_marker", [0,0]];
		sleep 0.1;
		arty_marker_t = "arty_marker";

		player onmapsingleclick "arty_marker_t setmarkerposlocal _pos; target_b2=true";

		[battery2, ammo_b2_c] call BIS_ARTY_F_LoadMapRanges;

		maxRange = battery2 getVariable "ARTY_MAX_RANGE";
		minRange = battery2 getVariable "ARTY_MIN_RANGE";

		[("max_range" setmarkerposlocal getpos battery_vehicle2),("max_range" setmarkersizelocal [maxrange,maxrange])];
		[("min_range" setmarkerposlocal getpos battery_vehicle2),("min_range" setmarkersizelocal [minRange,minRange])];

		hintsilent "Click on the Map to set the target";

		waituntil {target_b2};

		_marker setMarkerShapelocal "ICON";
		"arty_marker" setMarkerTypelocal "hd_destroy";
		"arty_marker" setMarkerColorlocal "Colorred";

		sleep 0.05;

		player onmapsingleclick "nil";

		"max_range" setmarkersizelocal [0,0];
		"max_range" setmarkerposlocal [0,0];
		"min_range" setmarkersizelocal [0,0];
		"min_range" setmarkerposlocal [0,0];

		hintsilent "Your target is marked";

		main_menu = [] execvm "artillery_ssp\menu\support.sqf";
		target_b2 = false;
	}
	else
	{
		hintsilent "Unable... Fire Mission in Progress";
		sleep 3;
		main_menu = [] execvm "artillery_ssp\menu\support.sqf";
	};
};


if battery_3 then
{
	if not (mission) then
	{
		target_b3 = false;
		deletemarkerlocal "arty_marker";

		sleep 0.1;

		_marker = createMarkerLocal ["arty_marker", [0,0]];
		sleep 0.1;
		arty_marker_t = "arty_marker";

		player onmapsingleclick "arty_marker_t setmarkerposlocal _pos; target_b3=true";

		[battery3, ammo_b3_c] call BIS_ARTY_F_LoadMapRanges;

		maxRange = battery3 getVariable "ARTY_MAX_RANGE";
		minRange = battery3 getVariable "ARTY_MIN_RANGE";

		[("max_range" setmarkerposlocal getpos battery_vehicle3),("max_range" setmarkersizelocal [maxrange,maxrange])];
		[("min_range" setmarkerposlocal getpos battery_vehicle3),("min_range" setmarkersizelocal [minRange,minRange])];

		hintsilent "Click on the Map to set the target";

		waituntil {target_b3};

		_marker setMarkerShapelocal "ICON";
		"arty_marker" setMarkerTypelocal "hd_destroy";
		"arty_marker" setMarkerColorlocal "Colorred";

		sleep 0.05;

		player onmapsingleclick "nil";

		"max_range" setmarkersizelocal [0,0];
		"max_range" setmarkerposlocal [0,0];
		"min_range" setmarkersizelocal [0,0];
		"min_range" setmarkerposlocal [0,0];

		hintsilent "Your target is marked";

		main_menu = [] execvm "artillery_ssp\menu\support.sqf";
		target_b3 = false;
	}
	else
	{
		hintsilent "Unable... Fire Mission in Progress";
		sleep 3;
		main_menu = [] execvm "artillery_ssp\menu\support.sqf";
	};
};