local DRoundTimerLength = 720 --how long the round will be in seconds
local forttimenum = 10
local phase1 = 60
local phase2 = 120
local phase3 = 180
local phase4 = 240
local plys = player.GetAll( )
function GM:Think()
if team.NumPlayers( 1 ) > 0 then
RoundType = "players"
else
RoundType = "NoPlayers"
end
end
function GM:Initialize()
--player.GetAll():PrintMessage( HUD_PRINTTALK, "Build a fort." )
timer.Create("phase1", 10, 1, PhaseI)
end
function PhaseI()
--player.GetAll():PrintMessage( HUD_PRINTTALK, "Phase one, 5 manhacks. Two realesed every second." )
timer.Create("phase2", 60, 1, PhaseII)
ManhackSpawn( 2.5, .50 )
end
function PhaseII()
--player.GetAll():PrintMessage( HUD_PRINTTALK, "Phase two, 15 manhacks. Two realesed every second." )
timer.Create("phase3", 120, 1, PhaseIII)
ManhackSpawn( 7.5, .50 )
end
function PhaseIII()
--player.GetAll():PrintMessage( HUD_PRINTTALK, "Phase two, 30 manhacks. Four realesed every second." )
timer.Create("phase4", 180, 1, PhaseIV)
ManhackSpawn( 7.5, .50 )
end
function PhaseIV()
--player.GetAll():PrintMessage( HUD_PRINTTALK, "Phase two, 40 manhacks. Four realesed every second." )
ManhackSpawn( 10, .25 )
end
function ManhackSpawn( count, interval)
timer.Create("Manhackcount", interval, count, ManhackSpawn2)
end
function ManhackSpawn2()
local SpawnPos = {}
SpawnPos[1]= ents.FindByName("mha1")[1]:GetPos()
SpawnPos[2]= ents.FindByName("mha2")[1]:GetPos()
SpawnPos[3]= ents.FindByName("mha3")[1]:GetPos()
SpawnPos[4]= ents.FindByName("mha4")[1]:GetPos()
local tableRand = table.Random( SpawnPos )
local manhackent = ents.Create( "npc_manhack" )
manhackent:SetPos( tableRand )
manhackent:SetAngles( ents.FindByClass("info_player_start")[1]:GetAngles() )
manhackent:Spawn()
end
function DRoundType()
Msg( RoundType )
end