From 868e729d68b5913716bfe5ddb512f4099851e9a2 Mon Sep 17 00:00:00 2001 From: Apickx Date: Mon, 28 Dec 2015 19:18:30 -0500 Subject: Initial commit --- gamemode/sv_various/hooks.lua | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 gamemode/sv_various/hooks.lua (limited to 'gamemode/sv_various/hooks.lua') diff --git a/gamemode/sv_various/hooks.lua b/gamemode/sv_various/hooks.lua new file mode 100644 index 0000000..58bfcb4 --- /dev/null +++ b/gamemode/sv_various/hooks.lua @@ -0,0 +1,29 @@ + +// :O + +util.AddNetworkString( "SunPos" ) + + +hook.Add("Initialize","LoadGearFox",function() + resource.AddDir("materials/gearfox") + resource.AddDir("materials/mawbase") + resource.AddDir("models/gearfox") + resource.AddDir("sound/mawbase") +end) + + +hook.Add("InitPostEntity","LoadGearFoxSunPos",function() + local Sun = ents.FindByClass("env_sun")[1] + + if (!IsValid(Sun)) then return end + + GM = GM or GAMEMODE + + local Ang = Sun:GetAngles() + Ang.p = Sun:GetKeyValues().pitch + Ang.y = Ang.y+180 + + local Pos = Ang:Forward()*10 + + GM:SetGlobalSHVar("SunPos",Pos) +end) \ No newline at end of file -- cgit v1.2.3-70-g09d2