diff options
Diffstat (limited to 'gamemode/sv_various/hooks.lua')
| -rw-r--r-- | gamemode/sv_various/hooks.lua | 29 |
1 files changed, 29 insertions, 0 deletions
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 |
