-------------------------------------------------
--[[CREDITS]]
-------------------------------------------------

--Original script by Ruosteinen ( Thanks for the permission )
--Edited by Me Death_htaed
-------------------------------------------------
--[[ IMPORTS ]]
-------------------------------------------------
import("ScarUtil.scar")
import("WXPScarUtil.scar")

-------------------------------------------------
--[[ON GAME SETUP]]
-------------------------------------------------
g_Player1 = World_GetPlayerAt(0)
g_Player2 = World_GetPlayerAt(1)
g_Player3 = World_GetPlayerAt(2)
g_Player4 = World_GetPlayerAt(3)
g_Player5 = World_GetPlayerAt(4)
g_Player6 = World_GetPlayerAt(5)
g_Player7 = World_GetPlayerAt(6)
g_Player8 = World_GetPlayerAt(7)
g_TunnelDelay = 3
g_EntryCount = 0
g_ExitCount = 0
g_SimulCount = 0
t_Tunnel1Queue = { }
t_Tunnel2Queue = { }
t_Tunnel3Queue = { }
t_Tunnel4Queue = { }
t_Tunnel5Queue = { }
t_Tunnel6Queue = { }
t_Tunnel7Queue = { }
t_Tunnel8Queue = { }
t_Tunnel9Queue = { }
t_Tunnel10Queue = { }
t_Tunnel11Queue = { }
t_Tunnel13Queue = { }
t_Tunnel14Queue = { }
t_Tunnel15Queue = { }
t_Tunnel16Queue = { }
t_Tunnel17Queue = { }
t_Tunnel18Queue = { }
t_Tunnel19Queue = { }
t_Tunnel20Queue = { }
t_Tunnel21Queue = { }
t_Tunnel22Queue = { }
t_Tunnel23Queue = { }
t_Tunnel24Queue = { }
t_Tunnel25Queue = { }
t_Tunnel26Queue = { }
t_Tunnel27Queue = { }
t_Tunnel28Queue = { }
t_Tunnel29Queue = { }
t_Tunnel30Queue = { }
t_Tunnel31Queue = { }
t_Tunnel32Queue = { }
t_Tunnel33Queue = { }
t_Tunnel34Queue = { }
t_Tunnel35Queue = { }
t_Tunnel36Queue = { }
t_Tunnel37Queue = { }
t_Tunnel38Queue = { }
t_Tunnel39Queue = { }
t_Tunnel40Queue = { }
t_Tunnel41Queue = { }
t_Tunnel42Queue = { }
t_Tunnel43Queue = { }
t_Tunnel44Queue = { }
t_Tunnel45Queue = { }
t_Tunnel46Queue = { }
t_Tunnel47Queue = { }
t_Tunnel48Queue = { }
t_Tunnel49Queue = { }

-------------------------------------------------
--[[ ON INITIALIZATION ]]
-------------------------------------------------

function OnInit()

	Rule_AddInterval( Rule_Tunnel1, 2 )
  Rule_AddIntervalDelay( Rule_Tunnel2, 2, 0 )
  Rule_AddIntervalDelay( Rule_Tunnel3, 2, 0 )
  Rule_AddIntervalDelay( Rule_Tunnel4, 2, 0 )
  Rule_AddIntervalDelay( Rule_Tunnel5, 2, 0.125 )
  Rule_AddIntervalDelay( Rule_Tunnel6, 2, 0.125 )
  Rule_AddIntervalDelay( Rule_Tunnel7, 2, 0.125 )
  Rule_AddIntervalDelay( Rule_Tunnel8, 2, 0.25 )
  Rule_AddIntervalDelay( Rule_Tunnel9, 2, 0.25 )
  Rule_AddIntervalDelay( Rule_Tunnel10, 2, 0.25 )
  Rule_AddIntervalDelay( Rule_Tunnel11, 2, 0.5 )
  Rule_AddIntervalDelay( Rule_Tunnel13, 2, 0.5 )
  Rule_AddIntervalDelay( Rule_Tunnel14, 2, 0.5 )
  Rule_AddIntervalDelay( Rule_Tunnel15, 2, 0.625 )
  Rule_AddIntervalDelay( Rule_Tunnel16, 2, 0.625 )
  Rule_AddIntervalDelay( Rule_Tunnel17, 2, 0.625 )
  Rule_AddIntervalDelay( Rule_Tunnel18, 2, 0.75 )
  Rule_AddIntervalDelay( Rule_Tunnel19, 2, 0.75 )
  Rule_AddIntervalDelay( Rule_Tunnel20, 2, 0.75 )
  Rule_AddIntervalDelay( Rule_Tunnel21, 2, 0.875 )
  Rule_AddIntervalDelay( Rule_Tunnel22, 2, 0.875 )
  Rule_AddIntervalDelay( Rule_Tunnel23, 2, 0.875 )
  Rule_AddIntervalDelay( Rule_Tunnel24, 2, 1 )
  Rule_AddIntervalDelay( Rule_Tunnel25, 2, 1 )
  Rule_AddIntervalDelay( Rule_Tunnel26, 2, 1 )
  Rule_AddIntervalDelay( Rule_Tunnel27, 2, 1.125 )
  Rule_AddIntervalDelay( Rule_Tunnel28, 2, 1.125 )
  Rule_AddIntervalDelay( Rule_Tunnel29, 2, 1.125 )
  Rule_AddIntervalDelay( Rule_Tunnel30, 2, 1.25 )
  Rule_AddIntervalDelay( Rule_Tunnel31, 2, 1.25 )
  Rule_AddIntervalDelay( Rule_Tunnel32, 2, 1.25 )
  Rule_AddIntervalDelay( Rule_Tunnel33, 2, 1.375 )
  Rule_AddIntervalDelay( Rule_Tunnel34, 2, 1.375 )
  Rule_AddIntervalDelay( Rule_Tunnel35, 2, 1.375 )
  Rule_AddIntervalDelay( Rule_Tunnel36, 2, 0.375 )
  Rule_AddIntervalDelay( Rule_Tunnel37, 2, 0.375 )
  Rule_AddIntervalDelay( Rule_Tunnel38, 2, 0.375 )
  Rule_AddIntervalDelay( Rule_Tunnel39, 2, 1.5 )
  Rule_AddIntervalDelay( Rule_Tunnel40, 2, 1.5 )
  Rule_AddIntervalDelay( Rule_Tunnel41, 2, 1.5 )
  Rule_AddIntervalDelay( Rule_Tunnel42, 2, 1.625 )
  Rule_AddIntervalDelay( Rule_Tunnel43, 2, 1.625 )
  Rule_AddIntervalDelay( Rule_Tunnel44, 2, 1.625 )
  Rule_AddIntervalDelay( Rule_Tunnel45, 2, 1.75 )
  Rule_AddIntervalDelay( Rule_Tunnel46, 2, 1.75 )
  Rule_AddIntervalDelay( Rule_Tunnel47, 2, 1.75 )
  Rule_AddIntervalDelay( Rule_Tunnel48, 2, 1.875 )
  Rule_AddIntervalDelay( Rule_Tunnel49, 2, 1.875 )
end

--[[ the Scar_AddInit(OnInit) function is mandatory! This registers your init function with scar. ]]
Scar_AddInit(OnInit)

-------------------------------------------------
--[[ TUNNELS ]]
-------------------------------------------------

function Rule_Tunnel1()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_1" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_1" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_1" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_1" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_1" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_1" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_1" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_1" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_1" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_1" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_1" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_1" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_1" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_1" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_1" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_1" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel1Queue, 0)
	end
	
	local numQueuing = table.getn(t_Tunnel1Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel1Queue[i] = t_Tunnel1Queue[i] + 1
		end
		
		-- spawns the next squad if it's been in long enough
		if t_Tunnel1Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_2" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel1Queue, 1)
		end
	end	
end


function Rule_Tunnel2()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_3" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_3" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_3" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_3" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_3" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_3" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_3" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_3" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_3" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_3" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_3" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_3" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_3" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_3" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_3" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_3" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel2Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel2Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel2Queue[i] = t_Tunnel2Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel2Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_4" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel2Queue, 1)
		end
	end
end


function Rule_Tunnel3()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_5" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_5" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_5" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_5" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_5" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_5" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_5" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_5" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_5" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_5" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_5" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_5" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_5" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_5" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_5" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_5" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel3Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel3Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel3Queue[i] = t_Tunnel3Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel3Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_6" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel3Queue, 1)
		end
	end
end


function Rule_Tunnel4()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_7" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_7" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_7" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_7" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_7" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_7" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_7" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_7" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_7" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_7" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_7" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_7" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_7" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_7" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_7" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_7" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel4Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel4Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel4Queue[i] = t_Tunnel4Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel4Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_8" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel4Queue, 1)
		end
	end
end


function Rule_Tunnel5()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_9" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_9" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_9" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_9" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_9" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_9" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_9" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_9" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_9" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_9" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_9" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_9" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_9" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_9" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_9" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_9" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel5Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel5Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel5Queue[i] = t_Tunnel5Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel5Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_10" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel5Queue, 1)
		end
	end
end


function Rule_Tunnel6()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_11" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_11" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_11" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_11" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_11" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_11" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_11" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_11" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_11" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_11" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_11" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_11" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_11" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_11" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_11" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_11" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel6Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel6Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel6Queue[i] = t_Tunnel6Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel6Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_12" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel6Queue, 1)
		end
	end
end


function Rule_Tunnel7()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_13" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_13" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_13" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_13" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_13" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_13" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_13" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_13" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_13" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_13" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_13" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_13" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_13" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_13" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_13" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_13" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel7Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel7Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel7Queue[i] = t_Tunnel7Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel7Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_14" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel7Queue, 1)
		end
	end
end


function Rule_Tunnel8()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_15" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_15" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_15" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_15" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_15" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_15" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_15" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_15" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_15" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_15" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_15" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_15" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_15" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_15" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_15" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_15" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel8Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel8Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel8Queue[i] = t_Tunnel8Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel8Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_16" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel8Queue, 1)
		end
	end
end


function Rule_Tunnel9()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_17" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_17" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_17" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_17" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_17" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_17" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_17" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_17" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_17" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_17" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_17" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_17" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_17" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_17" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_17" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_17" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel9Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel9Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel9Queue[i] = t_Tunnel9Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel9Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_18" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel9Queue, 1)
		end
	end
end


function Rule_Tunnel10()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_19" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_19" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_19" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_19" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_19" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_19" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_19" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_19" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_19" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_19" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_19" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_19" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_19" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_19" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_19" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_19" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel10Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel10Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel10Queue[i] = t_Tunnel10Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel10Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_20" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel10Queue, 1)
		end
	end
end


function Rule_Tunnel11()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_21" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_21" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_21" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_21" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_21" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_21" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_21" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_21" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_21" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_21" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_21" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_21" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_21" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_21" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_21" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_21" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel11Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel11Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel11Queue[i] = t_Tunnel11Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel11Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_22" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel11Queue, 1)
		end
	end
end


function Rule_Tunnel13()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_25" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_25" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_25" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_25" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_25" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_25" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_25" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_25" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_25" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_25" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_25" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_25" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_25" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_25" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_25" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_25" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel13Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel13Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel13Queue[i] = t_Tunnel13Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel13Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_26" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel13Queue, 1)
		end
	end
end


function Rule_Tunnel14()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_27" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_27" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_27" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_27" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_27" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_27" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_27" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_27" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_27" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_27" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_27" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_27" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_27" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_27" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_27" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_27" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel14Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel14Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel14Queue[i] = t_Tunnel14Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel14Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_28" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel14Queue, 1)
		end
	end
end


function Rule_Tunnel15()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_29" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_29" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_29" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_29" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_29" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_29" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_29" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_29" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_29" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_29" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_29" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_29" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_29" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_29" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_29" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_29" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel15Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel15Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel15Queue[i] = t_Tunnel15Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel15Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_30" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel15Queue, 1)
		end
	end
end


function Rule_Tunnel16()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_31" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_31" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_31" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_31" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_31" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_31" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_31" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_31" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_31" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_31" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_31" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_31" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_31" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_31" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_31" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_31" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel16Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel16Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel16Queue[i] = t_Tunnel16Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel16Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_32" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel16Queue, 1)
		end
	end
end


function Rule_Tunnel17()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_33" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_33" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_33" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_33" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_33" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_33" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_33" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_33" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_33" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_33" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_33" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_33" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_33" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_33" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_33" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_33" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel17Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel17Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel17Queue[i] = t_Tunnel17Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel17Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_34" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel17Queue, 1)
		end
	end
end


function Rule_Tunnel18()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_35" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_35" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_35" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_35" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_35" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_35" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_35" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_35" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_35" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_35" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_35" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_35" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_35" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_35" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_35" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_35" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel18Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel18Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel18Queue[i] = t_Tunnel18Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel18Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_36" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel18Queue, 1)
		end
	end
end


function Rule_Tunnel19()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_37" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_37" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_37" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_37" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_37" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_37" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_37" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_37" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_37" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_37" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_37" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_37" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_37" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_37" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_37" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_37" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel19Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel19Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel19Queue[i] = t_Tunnel19Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel19Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_38" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel19Queue, 1)
		end
	end
end


function Rule_Tunnel20()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_39" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_39" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_39" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_39" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_39" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_39" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_39" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_39" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_39" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_39" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_39" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_39" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_39" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_39" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_39" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_39" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel20Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel20Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel20Queue[i] = t_Tunnel20Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel20Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_40" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel20Queue, 1)
		end
	end
end


function Rule_Tunnel21()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_41" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_41" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_41" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_41" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_41" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_41" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_41" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_41" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_41" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_41" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_41" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_41" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_41" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_41" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_41" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_41" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel21Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel21Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel21Queue[i] = t_Tunnel21Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel21Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_42" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel21Queue, 1)
		end
	end
end


function Rule_Tunnel22()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_43" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_43" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_43" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_43" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_43" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_43" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_43" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_43" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_43" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_43" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_43" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_43" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_43" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_43" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_43" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_43" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel22Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel22Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel22Queue[i] = t_Tunnel22Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel22Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_44" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel22Queue, 1)
		end
	end
end


function Rule_Tunnel23()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_45" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_45" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_45" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_45" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_45" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_45" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_45" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_45" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_45" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_45" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_45" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_45" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_45" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_45" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_45" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_45" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel23Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel23Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel23Queue[i] = t_Tunnel23Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel23Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_46" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel23Queue, 1)
		end
	end
end


function Rule_Tunnel24()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_47" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_47" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_47" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_47" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_47" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_47" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_47" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_47" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_47" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_47" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_47" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_47" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_47" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_47" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_47" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_47" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel24Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel24Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel24Queue[i] = t_Tunnel24Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel24Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_48" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel24Queue, 1)
		end
	end
end


function Rule_Tunnel25()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_49" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_49" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_49" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_49" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_49" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_49" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_49" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_49" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_49" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_49" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_49" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_49" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_49" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_49" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_49" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_49" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel25Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel25Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel25Queue[i] = t_Tunnel25Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel25Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_50" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel25Queue, 1)
		end
	end
end


function Rule_Tunnel26()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_51" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_51" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_51" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_51" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_51" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_51" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_51" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_51" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_51" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_51" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_51" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_51" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_51" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_51" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_51" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_51" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel26Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel26Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel26Queue[i] = t_Tunnel26Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel26Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_52" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel26Queue, 1)
		end
	end
end


function Rule_Tunnel27()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_53" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_53" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_53" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_53" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_53" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_53" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_53" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_53" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_53" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_53" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_53" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_53" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_53" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_53" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_53" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_53" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel27Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel27Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel27Queue[i] = t_Tunnel27Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel27Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_54" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel27Queue, 1)
		end
	end
end


function Rule_Tunnel28()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_55" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_55" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_55" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_55" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_55" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_55" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_55" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_55" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_55" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_55" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_55" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_55" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_55" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_55" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_55" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_55" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel28Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel28Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel28Queue[i] = t_Tunnel28Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel28Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_56" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel28Queue, 1)
		end
	end
end


function Rule_Tunnel29()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_57" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_57" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_57" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_57" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_57" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_57" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_57" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_57" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_57" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_57" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_57" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_57" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_57" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_57" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_57" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_57" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel29Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel29Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel29Queue[i] = t_Tunnel29Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel29Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_58" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel29Queue, 1)
		end
	end
end


function Rule_Tunnel30()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_59" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_59" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_59" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_59" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_59" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_59" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_59" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_59" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_59" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_59" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_59" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_59" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_59" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_59" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_59" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_59" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel30Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel30Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel30Queue[i] = t_Tunnel30Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel30Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_60" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel30Queue, 1)
		end
	end
end


function Rule_Tunnel31()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_61" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_61" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_61" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_61" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_61" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_61" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_61" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_61" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_61" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_61" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_61" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_61" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_61" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_61" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_61" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_61" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel31Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel31Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel31Queue[i] = t_Tunnel31Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel31Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_62" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel31Queue, 1)
		end
	end
end


function Rule_Tunnel32()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_63" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_63" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_63" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_63" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_63" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_63" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_63" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_63" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_63" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_63" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_63" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_63" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_63" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_63" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_63" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_63" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel32Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel32Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel32Queue[i] = t_Tunnel32Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel32Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_64" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel32Queue, 1)
		end
	end
end


function Rule_Tunnel33()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_65" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_65" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_65" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_65" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_65" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_65" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_65" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_65" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_65" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_65" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_65" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_65" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_65" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_65" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_65" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_65" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel33Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel33Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel33Queue[i] = t_Tunnel33Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel33Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_66" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel33Queue, 1)
		end
	end
end


function Rule_Tunnel34()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_67" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_67" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_67" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_67" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_67" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_67" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_67" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_67" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_67" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_67" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_67" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_67" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_67" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_67" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_67" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_67" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel34Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel34Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel34Queue[i] = t_Tunnel34Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel34Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_68" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel34Queue, 1)
		end
	end
end


function Rule_Tunnel35()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_69" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_69" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_69" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_69" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_69" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_69" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_69" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_69" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_69" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_69" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_69" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_69" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_69" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_69" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_69" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_69" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel35Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel35Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel35Queue[i] = t_Tunnel35Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel35Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_70" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel35Queue, 1)
		end
	end
end


function Rule_Tunnel36()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_71" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_71" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_71" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_71" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_71" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_71" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_71" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_71" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_71" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_71" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_71" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_71" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_71" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_71" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_71" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_71" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel36Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel36Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel36Queue[i] = t_Tunnel36Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel36Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_72" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel36Queue, 1)
		end
	end
end


function Rule_Tunnel37()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_73" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_73" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_73" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_73" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_73" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_73" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_73" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_73" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_73" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_73" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_73" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_73" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_73" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_73" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_73" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_73" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel37Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel37Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel37Queue[i] = t_Tunnel37Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel37Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_74" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel37Queue, 1)
		end
	end
end


function Rule_Tunnel38()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_75" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_75" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_75" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_75" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_75" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_75" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_75" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_75" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_75" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_75" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_75" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_75" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_75" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_75" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_75" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_75" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel38Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel38Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel38Queue[i] = t_Tunnel38Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel38Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_76" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel38Queue, 1)
		end
	end
end


function Rule_Tunnel39()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_77" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_77" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_77" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_77" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_77" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_77" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_77" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_77" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_77" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_77" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_77" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_77" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_77" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_77" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_77" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_77" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel39Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel39Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel39Queue[i] = t_Tunnel39Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel39Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_78" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel39Queue, 1)
		end
	end
end


function Rule_Tunnel40()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_79" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_79" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_79" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_79" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_79" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_79" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_79" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_79" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_79" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_79" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_79" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_79" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_79" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_79" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_79" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_79" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel40Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel40Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel40Queue[i] = t_Tunnel40Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel40Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_80" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel40Queue, 1)
		end
	end
end


function Rule_Tunnel41()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_81" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_81" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_81" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_81" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_81" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_81" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_81" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_81" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_81" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_81" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_81" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_81" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_81" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_81" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_81" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_81" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel41Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel41Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel41Queue[i] = t_Tunnel41Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel41Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_82" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel41Queue, 1)
		end
	end
end


function Rule_Tunnel42()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_83" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_83" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_83" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_83" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_83" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_83" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_83" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_83" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_83" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_83" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_83" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_83" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_83" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_83" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_83" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_83" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel42Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel42Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel42Queue[i] = t_Tunnel42Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel42Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_84" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel42Queue, 1)
		end
	end
end


function Rule_Tunnel43()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_85" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_85" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_85" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_85" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_85" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_85" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_85" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_85" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_85" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_85" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_85" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_85" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_85" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_85" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_85" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_85" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel43Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel43Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel43Queue[i] = t_Tunnel43Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel43Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_86" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel43Queue, 1)
		end
	end
end


function Rule_Tunnel44()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_87" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_87" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_87" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_87" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_87" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_87" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_87" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_87" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_87" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_87" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_87" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_87" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_87" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_87" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_87" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_87" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel44Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel44Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel44Queue[i] = t_Tunnel44Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel44Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_88" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel44Queue, 1)
		end
	end
end


function Rule_Tunnel45()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_89" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_89" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_89" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_89" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_89" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_89" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_89" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_89" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_89" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_89" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_89" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_89" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_89" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_89" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_89" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_89" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel45Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel45Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel45Queue[i] = t_Tunnel45Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel45Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_90" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel45Queue, 1)
		end
	end
end


function Rule_Tunnel46()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_91" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_91" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_91" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_91" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_91" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_91" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_91" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_91" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_91" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_91" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_91" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_91" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_91" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_91" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_91" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_91" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel46Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel46Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel46Queue[i] = t_Tunnel46Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel46Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_92" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel46Queue, 1)
		end
	end
end


function Rule_Tunnel47()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_93" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_93" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_93" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_93" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_93" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_93" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_93" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_93" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_93" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_93" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_93" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_93" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_93" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_93" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_93" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_93" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel47Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel47Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel47Queue[i] = t_Tunnel47Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel47Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_94" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel47Queue, 1)
		end
	end
end


function Rule_Tunnel48()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_95" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_95" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_95" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_95" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_95" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_95" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_95" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_95" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_95" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_95" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_95" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_95" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_95" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_95" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_95" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_95" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel48Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel48Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel48Queue[i] = t_Tunnel48Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel48Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_96" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel48Queue, 1)
		end
	end
end


function Rule_Tunnel49()
--[[gets any squads near to the tunnel entrance and moves them to the tunnel exit]]
	if Player_AreSquadsNearMarker( g_Player1, "mkr_23" )
		or Player_AreSquadsNearMarker( g_Player2, "mkr_23" )
		or Player_AreSquadsNearMarker( g_Player3, "mkr_23" )
		or Player_AreSquadsNearMarker( g_Player4, "mkr_23" )
		or Player_AreSquadsNearMarker( g_Player5, "mkr_23" )
		or Player_AreSquadsNearMarker( g_Player6, "mkr_23" )
		or Player_AreSquadsNearMarker( g_Player7, "mkr_23" )
		or Player_AreSquadsNearMarker( g_Player8, "mkr_23" )
 	then
		-- get the squads and despawn them
		Player_GetAllSquadsNearMarker( g_Player1, "sg_tunnel"..g_EntryCount, "mkr_23" )
		Player_GetAllSquadsNearMarker( g_Player2, "sg_tunnel"..g_EntryCount, "mkr_23" )
		Player_GetAllSquadsNearMarker( g_Player3, "sg_tunnel"..g_EntryCount, "mkr_23" )
		Player_GetAllSquadsNearMarker( g_Player4, "sg_tunnel"..g_EntryCount, "mkr_23" )
		Player_GetAllSquadsNearMarker( g_Player5, "sg_tunnel"..g_EntryCount, "mkr_23" )
		Player_GetAllSquadsNearMarker( g_Player6, "sg_tunnel"..g_EntryCount, "mkr_23" )
		Player_GetAllSquadsNearMarker( g_Player7, "sg_tunnel"..g_EntryCount, "mkr_23" )
		Player_GetAllSquadsNearMarker( g_Player8, "sg_tunnel"..g_EntryCount, "mkr_23" )
		SGroup_DeSpawn( "sg_tunnel"..g_EntryCount )
		g_EntryCount = g_EntryCount+1
		table.insert(t_Tunnel49Queue, 0)
	end

	local numQueuing = table.getn(t_Tunnel49Queue)
	if numQueuing > 0 then
		-- loop through table, increasing all values by 1
		for i = 1, numQueuing do
			t_Tunnel49Queue[i] = t_Tunnel49Queue[i] + 1
		end

		-- spawns the next squad if it's been in long enough
		if t_Tunnel49Queue[1] >= g_TunnelDelay then
			SGroup_ReSpawnMarker( "sg_tunnel"..g_ExitCount, "mkr_24" )
			SGroup_Destroy( SGroup_FromName("sg_tunnel"..g_ExitCount) )
			g_ExitCount = g_ExitCount+1
			table.remove(t_Tunnel49Queue, 1)
		end
	end
end
