summaryrefslogtreecommitdiff
path: root/gamemode/events/supplycrate.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/events/supplycrate.lua')
-rw-r--r--gamemode/events/supplycrate.lua40
1 files changed, 40 insertions, 0 deletions
diff --git a/gamemode/events/supplycrate.lua b/gamemode/events/supplycrate.lua
new file mode 100644
index 0000000..35ca974
--- /dev/null
+++ b/gamemode/events/supplycrate.lua
@@ -0,0 +1,40 @@
+
+local EVENT = {}
+
+EVENT.Chance = 0.95
+EVENT.Type = EVENT_BONUS
+
+function EVENT:Start()
+
+ local spawns = ents.FindByClass( "info_lootspawn" )
+ local loot = table.Random( spawns )
+
+ if not IsValid( loot ) then MsgN( "ERROR: Unable to locate loot spawns. Map not configured?" ) return end
+
+ local ent = ents.Create( "sent_bonuscrate" )
+ ent:SetPos( loot:GetPos() + Vector(0,0,10) )
+ ent:Spawn()
+
+ for k,v in pairs( team.GetPlayers( TEAM_ARMY ) ) do
+
+ v:Notice( "Keep an eye out for a civilian weapon cache", GAMEMODE.Colors.White, 5 )
+
+ end
+
+end
+
+function EVENT:Think()
+
+end
+
+function EVENT:EndThink()
+
+ return true // true ends this immediately
+
+end
+
+function EVENT:End()
+
+end
+
+event.Register( EVENT )