summaryrefslogtreecommitdiff
path: root/gamemode/events/radio_blackout.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/events/radio_blackout.lua')
-rw-r--r--gamemode/events/radio_blackout.lua38
1 files changed, 38 insertions, 0 deletions
diff --git a/gamemode/events/radio_blackout.lua b/gamemode/events/radio_blackout.lua
new file mode 100644
index 0000000..27c5344
--- /dev/null
+++ b/gamemode/events/radio_blackout.lua
@@ -0,0 +1,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 )