summaryrefslogtreecommitdiff
path: root/gamemode/events/radioblackout.lua
blob: 27c534463caf1a8d13535217051b75c4c514de7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
local EVENT = {}

EVENT.Chance = 0.75
EVENT.Type = EVENT_BAD
EVENT.TimeText = { "30 seconds", "1 minute", "90 seconds" }  
EVENT.Times = { 30, 60, 90 }  

function EVENT:Start()
	
	local num = math.random(1,3)
	
	GAMEMODE.RadioBlock = CurTime() + EVENT.Times[ num ]
	
	for k,v in pairs( team.GetPlayers( TEAM_ARMY ) ) do
		
		v:Notice( "Radio communications will be down for " .. EVENT.TimeText[ num ], GAMEMODE.Colors.Red, 5 )
		v:Notice( "Radio communications are back online", GAMEMODE.Colors.White, 5, EVENT.Times[ num ] )
		
	end
	
end
	
function EVENT:Think()

end

function EVENT:EndThink()

	return true // true ends this immediately

end

function EVENT:End()

end

event.Register( EVENT )