SendCommercialPlaneTroughMap = function()
	Reinforcements.ReinforceWithTransport(neutral, "badr.commercial" .. tostring(Utils.RandomInteger(0, 6)), { "c" .. Utils.RandomInteger(1, 10), "c" .. Utils.RandomInteger(1, 10), "c" .. Utils.RandomInteger(1, 10), "c" .. Utils.RandomInteger(1, 10), "c" .. Utils.RandomInteger(1, 10), "c" .. Utils.RandomInteger(1, 10), "c" .. Utils.RandomInteger(1, 10), "c" .. Utils.RandomInteger(1, 10), "c" .. Utils.RandomInteger(1, 10), "c" .. Utils.RandomInteger(1, 10), "c" .. Utils.RandomInteger(1, 10), "c" .. Utils.RandomInteger(1, 10), "c" .. Utils.RandomInteger(1, 10), "c" .. Utils.RandomInteger(1, 10) }, { Map.RandomEdgeCell(), Map.RandomCell() }, nil,
	function(CommercialPlaneTrough, CommercialPlaneTroughCargo)
		CommercialPlaneTrough.Move(Map.RandomEdgeCell())
		CommercialPlaneTrough.Destroy()
		Utils.Do(CommercialPlaneTroughCargo, function(CommercialPlaneTroughActor)
		end)
		Trigger.OnRemovedFromWorld(CommercialPlaneTrough, function()
			Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(8.8, 24.8)), function()
				SendFreePlaneTroughMap() 
			end) 
		end)
	end)
end
SendFreePlaneTroughMap = function()
	Reinforcements.ReinforceWithTransport(neutral, "badr.free" .. tostring(Utils.RandomInteger(0, 1)), { "c" .. Utils.RandomInteger(1, 10), "c" .. Utils.RandomInteger(1, 10) }, { Map.RandomEdgeCell(), Map.RandomCell() }, nil,
	function(FreePlaneTrough, FreePlaneTroughCargo)
		FreePlaneTrough.Move(Map.RandomEdgeCell())
		FreePlaneTrough.Destroy()
		Utils.Do(FreePlaneTroughCargo, function(FreePlaneTroughActor)
		end)
		Trigger.OnRemovedFromWorld(FreePlaneTrough, function()
			Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(8.8, 24.8)), function() 
				SendMilitaryPlaneTroughMap() 
			end) 
		end)
	end)
end
SendMilitaryPlaneTroughMap = function()
	Reinforcements.ReinforceWithTransport(Utils.Random({ allies, england, france, germany, ussr, russia, ukraine, china }), "badr", { "e" .. Utils.RandomInteger(1, 6), "e" .. Utils.RandomInteger(1, 6), "e" .. Utils.RandomInteger(1, 6), "e" .. Utils.RandomInteger(1, 6), "e" .. Utils.RandomInteger(1, 6), "e" .. Utils.RandomInteger(1, 6), "e" .. Utils.RandomInteger(1, 6), "e" .. Utils.RandomInteger(1, 6), "e" .. Utils.RandomInteger(1, 6), "e" .. Utils.RandomInteger(1, 6), "e" .. Utils.RandomInteger(1, 6), "e" .. Utils.RandomInteger(1, 6), "e" .. Utils.RandomInteger(1, 6), "e" .. Utils.RandomInteger(1, 6) }, { Map.RandomEdgeCell(), Map.RandomCell() }, nil,
	function(MilitaryPlaneTrough, MilitaryPlaneTroughCargo)
		MilitaryPlaneTrough.Move(Map.RandomEdgeCell())
		MilitaryPlaneTrough.Destroy()
		Utils.Do(MilitaryPlaneTroughCargo, function(MilitaryPlaneTroughActor)
		end)
		Trigger.OnRemovedFromWorld(MilitaryPlaneTrough, function()
			Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(8.8, 24.8)), function() 
				SendSpaceHuttleTroughMap() 
			end)
		end)
	end)
end
SendSpaceHuttleTroughMap = function()
	Reinforcements.ReinforceWithTransport(Utils.Random({ allies, england, france, germany, ussr, russia, ukraine, china }), SpaceShuttleTypes, { "pilot", "e" .. Utils.RandomInteger(1, 6), FCrateTypes[Utils.RandomInteger(1, 11)], FCrateTypes[Utils.RandomInteger(1, 11)] }, { Map.RandomEdgeCell(), Map.RandomCell() }, nil,
	function(SpaceHuttleTrough, SpaceHuttleTroughCargo)
		SpaceHuttleTrough.Move(Map.RandomEdgeCell())
		SpaceHuttleTrough.Destroy()
		Utils.Do(SpaceHuttleTroughCargo, function(SpaceHuttleTroughActor) 
		end)
		Trigger.OnRemovedFromWorld(SpaceHuttleTrough, function()
			Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(8.8, 24.8)), function()
				SendCommercialPlaneTroughMap() 
			end)
		end)
	end)
end
SendCivilHeli = function()
	CivilHeliIdle = false
	CivilHeliPadRevokeEnabled = false
	local CivilHeliPad = Utils.Random({ CityHouseBuildingA20, CityHouseBuildingB20, CityHouseBuildingC20, CityHouseBuildingD20 })
	local CivilHeliOwner = CivilHeliPad.Owner
--	CivilHeliPad.GrantUpgrade("missionmarker.empty")
--	CivilHeliPad.GrantUpgrade("missionmarker.enabled")
	Reinforcements.ReinforceWithTransport(Utils.Random({ neutral, neutral0, neutral1, neutral2, neutral3 }), "tran.arm", InsertCivilHeloPassengerTypes, { Map.RandomEdgeCell(), CivilHeliPad.Location + CVec.New(Utils.RandomInteger(-2, 2), Utils.RandomInteger(-2, 2)) }, nil,
	function(CivilHeli, CivilPassengers)
		CivilHeli.Owner = CivilHeliOwner
		CivilHeli.Move(CivilHeliPad.Location + CVec.New(Utils.RandomInteger(-1, 1), Utils.RandomInteger(-1, 1)))
		CivilHeli.ReturnToBase(CivilHeliPad)
		Trigger.OnIdle(CivilHeli, function(CivilHeli) 
			if not CivilHeliIdle then
--				CivilHeliPad.RevokeUpgrade("missionmarker.empty")
--				CivilHeliPad.GrantUpgrade("missionmarker.enabled")
				CivilHeliIdle = true
				CivilHeli.Wait(Utils.RandomInteger(66, 88))
				CivilHeli.UnloadPassengers()
				CivilHeli.Wait(Utils.RandomInteger(222, 444))
				CivilHeli.Move(Map.RandomEdgeCell())
				CivilHeli.Destroy()
				Utils.Do(CivilPassengers, function(Civilians)
					Trigger.OnAddedToWorld(Civilians, function(civ) 
						CitizensCount = CitizensCount + 1
						Trigger.OnRemovedFromWorld(civ, function() 
							CitizensCount = CitizensCount - 1
						end)
						Civilians.Move(CivilHeliPad.Location + CVec.New(Utils.RandomInteger(3, 4), Utils.RandomInteger(-2, 2)))
						Civilians.Wait(Utils.RandomInteger(111, 222))
						Civilians.Move(CivilHeliPad.Location + CVec.New(Utils.RandomInteger(12, 16), Utils.RandomInteger(12, 16)))
--						Trigger.AfterDelay(233, function()
--							if not CivilHeliPadRevokeEnabled then
--								CivilHeliPadRevokeEnabled = true
--								CivilHeliPad.RevokeUpgrade("missionmarker.enabled")
--							end
--						end)
					end)
				end)
			end
		end)
		Trigger.OnRemovedFromWorld(CivilHeli, function() 
--			CivilHeliPad.RevokeUpgrade("missionmarker.enabled")
			Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(66, 99)), function()
				SendCivilHeli()
			end)
		end)
	end)
end
SendCommercialPlane = function()
	CommercialPlaneIdle = false
	local CommercialPlaneType = "badr.commercial" .. Utils.RandomInteger(0, 6) .. ""
	local CommercialPlaneGetPassengerCircle = Utils.RandomInteger(14, 18)
	local CommercialCivilAirfield = Utils.Random({ CivilAirfield0, CivilAirfield1, CivilAirfield2, CivilAirfield3 })
	local CivilAirfieldOwner = CommercialCivilAirfield.Owner
	if CommercialCivilAirfield.Owner == neutral0 then
		local CommercialCityCenterPoints = CPos.New(44, 44)
		local CommercialCitySlippedPoints = CPos.New(44 + Utils.RandomInteger(6, 8), 44 + Utils.RandomInteger(6, 8))
		local CommercialCityCenterWaypoint = Actor.Create("waypoint", true, { Owner = clearpoint, Location = CommercialCityCenterPoints })
		local CommercialCitySlippedCenterWaypoint = Actor.Create("waypoint", true, { Owner = clearpoint, Location = CommercialCitySlippedPoints })
		local UsuallyCitizens = Map.ActorsInCircle(CommercialCityCenterWaypoint.CenterPosition + WVec.New(0, 0, 0), WDist.FromCells(CommercialPlaneGetPassengerCircle), function(self) return (self.Type == "c1" or self.Type == "c2" or self.Type == "c3" or self.Type == "c4" or self.Type == "c5" or self.Type == "c6" or self.Type == "c7" or self.Type == "c8" or self.Type == "c9" or self.Type == "c10") and (self.Owner == neutral or self.Owner == neutral0 or self.Owner == neutral1 or self.Owner == neutral2 or self.Owner == neutral3) end)
		Utils.Do(UsuallyCitizens, function(citizens)
			if not citizens.IsDead and citizens.IsInWorld then citizens.Move(CommercialCivilAirfield.Location + CVec.New(Utils.RandomInteger(1, 2), Utils.RandomInteger(-2, -1))) end
		end)
		Reinforcements.ReinforceWithTransport(Utils.Random({ neutral, neutral0, neutral1, neutral2, neutral3 }), CommercialPlaneType, CommercialPlaneCitizenCargoTypes, { Map.RandomEdgeCell(), CommercialCivilAirfield.Location }, nil,
		function(CommercialPlane, CivilianCargo)
			if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.ReturnToBase(CommercialCivilAirfield) end
			Trigger.AfterDelay(DateTime.Seconds(55), function()
				if multi0.IsBot and multi1.IsBot and multi2.IsBot and multi3.IsBot then
				else
					Utils.Do(players, function(player)
--						Media.PlayMovieInRadar(("Videos/747Landed.vqa" or "" or "" or ""), nil)
					end)
				end
			end)
--			Trigger.AfterDelay(DateTime.Seconds(222), function()
--				if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.GrantUpgrade("missionmarker.enabled") end
--			end)
			Trigger.AfterDelay(DateTime.Seconds(780), function()
				if multi0.IsBot and multi1.IsBot and multi2.IsBot and multi3.IsBot then
				else
					Utils.Do(players, function(player)
--						Media.PlayMovieInRadar(("" or "Videos/boeing.vqa" or "" or ""), nil)
					end)
				end
			end)
			Trigger.OnIdle(CommercialPlane, function()
				if not CommercialPlaneIdle then
					CommercialPlaneIdle = true
--					Trigger.AfterDelay(1166, function() Trigger.ClearAll(UsuallyCitizens) end)
					if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.Wait(Utils.RandomInteger(36, 48)) end
					if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.UnloadPassengers() end
					if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.Wait(1111) end
					if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.Move(Map.RandomEdgeCell()) end
					if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.Destroy() end
					Utils.Do(UsuallyCitizens, function(leavecitypassengers)
						if not leavecitypassengers.IsDead and not CommercialPlane.IsDead and leavecitypassengers.IsInWorld then leavecitypassengers.Move(CommercialPlane.Location + CVec.New(Utils.RandomInteger(0, 2), -1)) end
						if not leavecitypassengers.IsDead and leavecitypassengers.IsInWorld then leavecitypassengers.Wait(Utils.RandomInteger(28, 36)) end
						if not leavecitypassengers.IsDead and not CommercialPlane.IsDead and leavecitypassengers.IsInWorld then leavecitypassengers.EnterTransport(CommercialPlane) end
					end)
					Utils.Do(CivilianCargo, function(civcargo)
						Trigger.OnAddedToWorld(civcargo, function(civ) 
							civ.GrantUpgrade("wandering")
							CitizensCount = CitizensCount + 1
							CitizensCount0 = CitizensCount0 + 1
							Trigger.OnRemovedFromWorld(civ, function() 
								CitizensCount = CitizensCount - 1
								CitizensCount0 = CitizensCount0 - 1
							end)
							Media.PlaySound("SoundFiles/CarDoorSounds/CarDoorSound" .. Utils.RandomInteger(1, 9) .. ".aud")
							if not civcargo.IsDead and civcargo.IsInWorld then civcargo.Owner = CivilAirfieldOwner end
							if not civcargo.IsDead and civcargo.IsInWorld then civcargo.Wait(Utils.RandomInteger(44, 88)) end
							if not civcargo.IsDead and not CommercialPlane.IsDead and civcargo.IsInWorld then civcargo.Move(CommercialPlane.Location + CVec.New(Utils.RandomInteger(6, 8), Utils.RandomInteger(-1, 1))) end
							if not civcargo.IsDead and civcargo.IsInWorld then civcargo.Wait(Utils.RandomInteger(44, 88)) end
							if not civcargo.IsDead and civcargo.IsInWorld then civcargo.Move(CommercialCitySlippedCenterWaypoint.Location) end
						end)
					end)
				end
			end)
			Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(28, 36)), function() if not CommercialPlane.IsIdle and CommercialPlane.IsInWorld and not CommercialPlane.IsDead and CommercialPlane.HasPassengers and not CommercialPlaneIdle then CommercialPlane.ReturnToBase(CommercialCivilAirfield) end end)
			Trigger.OnRemovedFromWorld(CommercialPlane, function() Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(14, 26)), function() SendFreePlane() end) end)
		end)
	elseif CommercialCivilAirfield.Owner == neutral1 then
		local CommercialCityCenterPoints = CPos.New(44, 100)
		local CommercialCitySlippedPoints = CPos.New(44 + Utils.RandomInteger(6, 8), 100 + Utils.RandomInteger(6, 8))
		local CommercialCityCenterWaypoint = Actor.Create("waypoint", true, { Owner = clearpoint, Location = CommercialCityCenterPoints })
		local CommercialCitySlippedCenterWaypoint = Actor.Create("waypoint", true, { Owner = clearpoint, Location = CommercialCitySlippedPoints })
		local UsuallyCitizens = Map.ActorsInCircle(CommercialCityCenterWaypoint.CenterPosition + WVec.New(0, 0, 0), WDist.FromCells(CommercialPlaneGetPassengerCircle), function(self) return (self.Type == "c1" or self.Type == "c2" or self.Type == "c3" or self.Type == "c4" or self.Type == "c5" or self.Type == "c6" or self.Type == "c7" or self.Type == "c8" or self.Type == "c9" or self.Type == "c10") and (self.Owner == neutral or self.Owner == neutral0 or self.Owner == neutral1 or self.Owner == neutral2 or self.Owner == neutral3) end)
		Utils.Do(UsuallyCitizens, function(citizens)
			if not citizens.IsDead and citizens.IsInWorld then citizens.Move(CommercialCivilAirfield.Location + CVec.New(Utils.RandomInteger(1, 2), Utils.RandomInteger(-2, -1))) end
		end)
		Reinforcements.ReinforceWithTransport(Utils.Random({ neutral, neutral0, neutral1, neutral2, neutral3 }), CommercialPlaneType, CommercialPlaneCitizenCargoTypes, { Map.RandomEdgeCell(), CommercialCivilAirfield.Location }, nil,
		function(CommercialPlane, CivilianCargo)
			if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.ReturnToBase(CommercialCivilAirfield) end
			Trigger.AfterDelay(DateTime.Seconds(55), function()
				if multi0.IsBot and multi1.IsBot and multi2.IsBot and multi3.IsBot then
				else
					Utils.Do(players, function(player)
--						Media.PlayMovieInRadar(("" or "Videos/747Landed.vqa" or "" or ""), nil)
					end)
				end
			end)
--			Trigger.AfterDelay(DateTime.Seconds(222), function()
--				if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.GrantUpgrade("missionmarker.enabled") end
--			end)
			Trigger.AfterDelay(DateTime.Seconds(780), function()
				if multi0.IsBot and multi1.IsBot and multi2.IsBot and multi3.IsBot then
				else
					Utils.Do(players, function(player)
--						Media.PlayMovieInRadar(("" or "Videos/boeing.vqa" or "" or ""), nil)
					end)
				end
			end)
			Trigger.OnIdle(CommercialPlane, function() 
				if not CommercialPlaneIdle then
					CommercialPlaneIdle = true
--					Trigger.AfterDelay(1166, function() Trigger.ClearAll(UsuallyCitizens) end)
					if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.Wait(Utils.RandomInteger(36, 48)) end
					if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.UnloadPassengers() end
					if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.Wait(1111) end
					if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.Move(Map.RandomEdgeCell()) end
					if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.Destroy() end
					Utils.Do(UsuallyCitizens, function(leavecitypassengers)
						if not leavecitypassengers.IsDead and not CommercialPlane.IsDead and leavecitypassengers.IsInWorld then leavecitypassengers.Move(CommercialPlane.Location + CVec.New(Utils.RandomInteger(0, 2), -1)) end
						if not leavecitypassengers.IsDead and leavecitypassengers.IsInWorld then leavecitypassengers.Wait(Utils.RandomInteger(28, 36)) end
						if not leavecitypassengers.IsDead and not CommercialPlane.IsDead and leavecitypassengers.IsInWorld then leavecitypassengers.EnterTransport(CommercialPlane) end
					end)
					Utils.Do(CivilianCargo, function(civcargo)
						Trigger.OnAddedToWorld(civcargo, function(civ) 
							civ.GrantUpgrade("wandering")
							CitizensCount = CitizensCount + 1
							CitizensCount1 = CitizensCount1 + 1
							Trigger.OnRemovedFromWorld(civ, function() 
								CitizensCount = CitizensCount - 1
								CitizensCount1 = CitizensCount1 - 1
							end)
							Media.PlaySound("SoundFiles/CarDoorSounds/CarDoorSound" .. Utils.RandomInteger(1, 9) .. ".aud") 
							if not civcargo.IsDead and civcargo.IsInWorld then civcargo.Owner = CivilAirfieldOwner end
							if not civcargo.IsDead and civcargo.IsInWorld then civcargo.Wait(Utils.RandomInteger(44, 88)) end
							if not civcargo.IsDead and not CommercialPlane.IsDead and civcargo.IsInWorld then civcargo.Move(CommercialPlane.Location + CVec.New(Utils.RandomInteger(6, 8), Utils.RandomInteger(-1, 1))) end
							if not civcargo.IsDead and civcargo.IsInWorld then civcargo.Wait(Utils.RandomInteger(44, 88)) end
							if not civcargo.IsDead and civcargo.IsInWorld then civcargo.Move(CommercialCitySlippedCenterWaypoint.Location) end
						end)
					end)
				end
			end)
			Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(28, 36)), function() if not CommercialPlane.IsIdle and CommercialPlane.IsInWorld and not CommercialPlane.IsDead and CommercialPlane.HasPassengers and not CommercialPlaneIdle then CommercialPlane.ReturnToBase(CommercialCivilAirfield) end end)
			Trigger.OnRemovedFromWorld(CommercialPlane, function() Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(14, 26)), function() SendFreePlane() end) end)
		end)
	elseif CommercialCivilAirfield.Owner == neutral2 then
		local CommercialCityCenterPoints = CPos.New(100, 44)
		local CommercialCitySlippedPoints = CPos.New(100 + Utils.RandomInteger(6, 8), 44 + Utils.RandomInteger(6, 8))
		local CommercialCityCenterWaypoint = Actor.Create("waypoint", true, { Owner = clearpoint, Location = CommercialCityCenterPoints })
		local CommercialCitySlippedCenterWaypoint = Actor.Create("waypoint", true, { Owner = clearpoint, Location = CommercialCitySlippedPoints })
		local UsuallyCitizens = Map.ActorsInCircle(CommercialCityCenterWaypoint.CenterPosition + WVec.New(0, 0, 0), WDist.FromCells(CommercialPlaneGetPassengerCircle), function(self) return (self.Type == "c1" or self.Type == "c2" or self.Type == "c3" or self.Type == "c4" or self.Type == "c5" or self.Type == "c6" or self.Type == "c7" or self.Type == "c8" or self.Type == "c9" or self.Type == "c10") and (self.Owner == neutral or self.Owner == neutral0 or self.Owner == neutral1 or self.Owner == neutral2 or self.Owner == neutral3) end)
		Utils.Do(UsuallyCitizens, function(citizens)
			if not citizens.IsDead and citizens.IsInWorld then citizens.Move(CommercialCivilAirfield.Location + CVec.New(Utils.RandomInteger(1, 2), Utils.RandomInteger(-2, -1))) end
		end)
		Reinforcements.ReinforceWithTransport(Utils.Random({ neutral, neutral0, neutral1, neutral2, neutral3 }), CommercialPlaneType, CommercialPlaneCitizenCargoTypes, { Map.RandomEdgeCell(), CommercialCivilAirfield.Location }, nil,
		function(CommercialPlane, CivilianCargo)
			if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.ReturnToBase(CommercialCivilAirfield) end
			Trigger.AfterDelay(DateTime.Seconds(55), function()
				if multi0.IsBot and multi1.IsBot and multi2.IsBot and multi3.IsBot then
				else
					Utils.Do(players, function(player)
--						Media.PlayMovieInRadar(("" or "" or "Videos/747Landed.vqa" or ""), nil)
					end)
				end
			end)
--			Trigger.AfterDelay(DateTime.Seconds(222), function()
--				if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.GrantUpgrade("missionmarker.enabled") end
--			end)
			Trigger.AfterDelay(DateTime.Seconds(780), function()
				if multi0.IsBot and multi1.IsBot and multi2.IsBot and multi3.IsBot then
				else
					Utils.Do(players, function(player)
						Media.PlayMovieInRadar(("" or "" or "Videos/boeing.vqa" or ""), nil)
					end)
				end
			end)
			Trigger.OnIdle(CommercialPlane, function() 
				if not CommercialPlaneIdle then
					CommercialPlaneIdle = true
--					Trigger.AfterDelay(1166, function() Trigger.ClearAll(UsuallyCitizens) end)
					if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.Wait(Utils.RandomInteger(36, 48)) end
					if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.UnloadPassengers() end
					if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.Wait(1111) end
					if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.Move(Map.RandomEdgeCell()) end
					if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.Destroy() end
					Utils.Do(UsuallyCitizens, function(leavecitypassengers)
						if not leavecitypassengers.IsDead and not CommercialPlane.IsDead and leavecitypassengers.IsInWorld then leavecitypassengers.Move(CommercialPlane.Location + CVec.New(Utils.RandomInteger(0, 2), -1)) end
						if not leavecitypassengers.IsDead and leavecitypassengers.IsInWorld then leavecitypassengers.Wait(Utils.RandomInteger(28, 36)) end
						if not leavecitypassengers.IsDead and not CommercialPlane.IsDead and leavecitypassengers.IsInWorld then leavecitypassengers.EnterTransport(CommercialPlane) end
					end)
					Utils.Do(CivilianCargo, function(civcargo)
						Trigger.OnAddedToWorld(civcargo, function(civ) 
							civ.GrantUpgrade("wandering")
							CitizensCount = CitizensCount + 1
							CitizensCount2 = CitizensCount2 + 1
							Trigger.OnRemovedFromWorld(civ, function() 
								CitizensCount = CitizensCount - 1
								CitizensCount2 = CitizensCount2 - 1
							end)
							Media.PlaySound("SoundFiles/CarDoorSounds/CarDoorSound" .. Utils.RandomInteger(1, 9) .. ".aud") 
							if not civcargo.IsDead and civcargo.IsInWorld then civcargo.Owner = CivilAirfieldOwner end
							if not civcargo.IsDead and civcargo.IsInWorld then civcargo.Wait(Utils.RandomInteger(44, 88)) end
							if not civcargo.IsDead and not CommercialPlane.IsDead and civcargo.IsInWorld then civcargo.Move(CommercialPlane.Location + CVec.New(Utils.RandomInteger(6, 8), Utils.RandomInteger(-1, 1))) end
							if not civcargo.IsDead and civcargo.IsInWorld then civcargo.Wait(Utils.RandomInteger(44, 88)) end
							if not civcargo.IsDead and civcargo.IsInWorld then civcargo.Move(CommercialCitySlippedCenterWaypoint.Location) end
						end)
					end)
				end
			end)
			Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(28, 36)), function() if not CommercialPlane.IsIdle and CommercialPlane.IsInWorld and not CommercialPlane.IsDead and CommercialPlane.HasPassengers and not CommercialPlaneIdle then CommercialPlane.ReturnToBase(CommercialCivilAirfield) end end)
			Trigger.OnRemovedFromWorld(CommercialPlane, function() Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(14, 26)), function() SendFreePlane() end) end)
		end)
	elseif CommercialCivilAirfield.Owner == neutral3 then
		local CommercialCityCenterPoints = CPos.New(100, 100)
		local CommercialCitySlippedPoints = CPos.New(100 + Utils.RandomInteger(6, 8), 100 + Utils.RandomInteger(6, 8))
		local CommercialCityCenterWaypoint = Actor.Create("waypoint", true, { Owner = clearpoint, Location = CommercialCityCenterPoints })
		local CommercialCitySlippedCenterWaypoint = Actor.Create("waypoint", true, { Owner = clearpoint, Location = CommercialCitySlippedPoints })
		local UsuallyCitizens = Map.ActorsInCircle(CommercialCityCenterWaypoint.CenterPosition + WVec.New(0, 0, 0), WDist.FromCells(CommercialPlaneGetPassengerCircle), function(self) return (self.Type == "c1" or self.Type == "c2" or self.Type == "c3" or self.Type == "c4" or self.Type == "c5" or self.Type == "c6" or self.Type == "c7" or self.Type == "c8" or self.Type == "c9" or self.Type == "c10") and (self.Owner == neutral or self.Owner == neutral0 or self.Owner == neutral1 or self.Owner == neutral2 or self.Owner == neutral3) end)
		Utils.Do(UsuallyCitizens, function(citizens)
			if not citizens.IsDead and citizens.IsInWorld then citizens.Move(CommercialCivilAirfield.Location + CVec.New(Utils.RandomInteger(1, 2), Utils.RandomInteger(-2, -1))) end
		end)
		Reinforcements.ReinforceWithTransport(Utils.Random({ neutral, neutral0, neutral1, neutral2, neutral3 }), CommercialPlaneType, CommercialPlaneCitizenCargoTypes, { Map.RandomEdgeCell(), CommercialCivilAirfield.Location }, nil,
		function(CommercialPlane, CivilianCargo)
			if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.ReturnToBase(CommercialCivilAirfield) end
			Trigger.AfterDelay(DateTime.Seconds(55), function()
				if multi0.IsBot and multi1.IsBot and multi2.IsBot and multi3.IsBot then
				else
					Utils.Do(players, function(player)
--						Media.PlayMovieInRadar(("" or "" or "" or "Videos/747Landed.vqa"), nil)
					end)
				end
			end)
--			Trigger.AfterDelay(DateTime.Seconds(222), function()
--				if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.GrantUpgrade("missionmarker.enabled") end
--			end)
			Trigger.AfterDelay(DateTime.Seconds(780), function()
				if multi0.IsBot and multi1.IsBot and multi2.IsBot and multi3.IsBot then
				else
					Utils.Do(players, function(player)
--						Media.PlayMovieInRadar(("" or "" or "" or "Videos/boeing.vqa"), nil)
					end)
				end
			end)
			Trigger.OnIdle(CommercialPlane, function() 
				if not CommercialPlaneIdle then
					CommercialPlaneIdle = true
--					Trigger.AfterDelay(1166, function() Trigger.ClearAll(UsuallyCitizens) end)
					if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.Wait(Utils.RandomInteger(36, 48)) end
					if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.UnloadPassengers() end
					if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.Wait(1111) end
					if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.Move(Map.RandomEdgeCell()) end
					if not CommercialPlane.IsDead and CommercialPlane.IsInWorld then CommercialPlane.Destroy() end
					Utils.Do(UsuallyCitizens, function(leavecitypassengers)
						if not leavecitypassengers.IsDead and not CommercialPlane.IsDead and leavecitypassengers.IsInWorld then leavecitypassengers.Move(CommercialPlane.Location + CVec.New(Utils.RandomInteger(0, 2), -1)) end
						if not leavecitypassengers.IsDead and leavecitypassengers.IsInWorld then leavecitypassengers.Wait(Utils.RandomInteger(28, 36)) end
						if not leavecitypassengers.IsDead and not CommercialPlane.IsDead and leavecitypassengers.IsInWorld then leavecitypassengers.EnterTransport(CommercialPlane) end
					end)
					Utils.Do(CivilianCargo, function(civcargo)
						Trigger.OnAddedToWorld(civcargo, function(civ) 
							civ.GrantUpgrade("wandering")
							CitizensCount = CitizensCount + 1
							CitizensCount3 = CitizensCount3 + 1
							Trigger.OnRemovedFromWorld(civ, function() 
								CitizensCount = CitizensCount - 1
								CitizensCount3 = CitizensCount3 - 1
							end)
							Media.PlaySound("SoundFiles/CarDoorSounds/CarDoorSound" .. Utils.RandomInteger(1, 9) .. ".aud") 
							if not civcargo.IsDead and civcargo.IsInWorld then civcargo.Owner = CivilAirfieldOwner end
							if not civcargo.IsDead and civcargo.IsInWorld then civcargo.Wait(Utils.RandomInteger(44, 88)) end
							if not civcargo.IsDead and not CommercialPlane.IsDead and civcargo.IsInWorld then civcargo.Move(CommercialPlane.Location + CVec.New(Utils.RandomInteger(6, 8), Utils.RandomInteger(-1, 1))) end
							if not civcargo.IsDead and civcargo.IsInWorld then civcargo.Wait(Utils.RandomInteger(44, 88)) end
							if not civcargo.IsDead and civcargo.IsInWorld then civcargo.Move(CommercialCitySlippedCenterWaypoint.Location) end
						end)
					end)
				end
			end)
			Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(28, 36)), function() if not CommercialPlane.IsIdle and CommercialPlane.IsInWorld and not CommercialPlane.IsDead and CommercialPlane.HasPassengers and not CommercialPlaneIdle then CommercialPlane.ReturnToBase(CommercialCivilAirfield) end end)
			Trigger.OnRemovedFromWorld(CommercialPlane, function() Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(14, 26)), function() SendFreePlane() end) end)
		end)
	end
end
SendFreePlane = function()
	FreePlaneIdle = false
	local FreeCivilAirfield = Utils.Random({ CivilAirfield0, CivilAirfield1, CivilAirfield2, CivilAirfield3 })
	local FreeCivilAirfieldOwner = FreeCivilAirfield.Owner
	Reinforcements.ReinforceWithTransport(Utils.Random({ neutral, neutral0, neutral1, neutral2, neutral3 }), "badr.free" .. tostring(Utils.RandomInteger(0, 1)), { "c" .. Utils.RandomInteger(1, 10), "c" .. Utils.RandomInteger(1, 10) }, { Map.ClosestEdgeCell(FreeCivilAirfield.Location ), FreeCivilAirfield.Location + CVec.New(Utils.RandomInteger(38, 39), 0) }, nil,
	function(FreePlane, FreeCargo)
--		if not FreePlane.IsDead and FreePlane.IsInWorld then FreePlane.Move(FreeCivilAirfield.Location + CVec.New(Utils.RandomInteger(37, 38), 0)) end
		if not FreePlane.IsDead and FreePlane.IsInWorld then FreePlane.ReturnToBase(FreeCivilAirfield) end
		Trigger.OnIdle(FreePlane, function() 
			if not FreePlaneIdle then
				if not FreePlane.IsDead and FreePlane.IsInWorld then FreePlane.Wait(Utils.RandomInteger(44, 66)) end
				if not FreePlane.IsDead and FreePlane.IsInWorld then FreePlane.UnloadPassengers() end
				if not FreePlane.IsDead and FreePlane.IsInWorld then FreePlane.Wait(Utils.RandomInteger(333, 666)) end
				if not FreePlane.IsDead and FreePlane.IsInWorld then FreePlane.Move(Map.RandomEdgeCell()) end
				if not FreePlane.IsDead and FreePlane.IsInWorld then FreePlane.Destroy() end
				FreePlaneIdle = true
				Utils.Do(FreeCargo, function(civcargo)
					Trigger.OnAddedToWorld(civcargo, function(civ) 
						civ.GrantUpgrade("wandering")
						CitizensCount = CitizensCount + 1
						Trigger.OnRemovedFromWorld(civ, function() 
							CitizensCount = CitizensCount - 1
						end)
						Media.PlaySound("SoundFiles/CarDoorSounds/CarDoorSound" .. Utils.RandomInteger(1, 9) .. ".aud") 
						if not civcargo.IsDead and civcargo.IsInWorld then civcargo.Owner = FreeCivilAirfieldOwner end
						if not civcargo.IsDead and civcargo.IsInWorld then civcargo.Wait(Utils.RandomInteger(44, 88)) end
						if not civcargo.IsDead and not FreePlane.IsDead and civcargo.IsInWorld then civcargo.Move(FreePlane.Location + CVec.New(Utils.RandomInteger(8, 10), Utils.RandomInteger(8, 10))) end
					end)
				end)
			end
		end)
		Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(33, 44)), function() if not FreePlane.IsIdle and FreePlane.IsInWorld and not FreePlane.IsDead and FreePlane.HasPassengers and not FreePlaneIdle then FreePlane.ReturnToBase(FreeCivilAirfield) end end)
		Trigger.OnRemovedFromWorld(FreePlane, function() Trigger.AfterDelay(DateTime.Seconds(Utils.RandomInteger(66, 99)), function() SendCommercialPlane() end) end)
	end)
end

