Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- sh_fog.lua
- globalFogDed = 2700
- if CLIENT then
- RunConsoleCommand("r_3dsky", 0)
- hook.Add( "SetupWorldFog", "FoxController", function()
- if globalFogDed then
- render.FogMode( 1 )
- render.FogStart( globalFogDed - 350 )
- render.FogEnd( globalFogDed - 150 )
- render.FogMaxDensity( 1 )
- local col = Vector(0.8,0.8,0.8)
- render.FogColor( col.x * 255, col.y * 255, col.z * 255 )
- return true
- end
- end )
- hook.Add( "SetupSkyboxFog", "FoxControllerSky", function()
- if globalFogDed then
- render.FogMode(MATERIAL_FOG_LINEAR)
- render.FogStart( (globalFogDed-600)/16-(200/16) )
- render.FogEnd( globalFogDed/16-(200/16) )
- render.FogMaxDensity( 1 )
- local col = Vector(0.8,0.8,0.8)
- render.FogColor( col.x * 255, col.y * 255, col.z * 255 )
- return true
- end
- end )
- hook.Add("NetworkEntityCreated", "hideshit", function(ent) -- скрывает энтити в тумане
- timer.Simple(1, function()
- if !IsValid(ent) then return end
- ent.RenderOverride = function()
- if (LocalPlayer():GetPos():Distance(ent:GetPos()) < globalFogDed) then
- ent:DrawModel()
- end
- end
- end)
- end)
- end
- if SERVER then
- entFog = false
- function DedrussFPSfix()
- for k, v in ipairs( ents.GetAll( ) ) do
- if v:GetClass( ) == "env_fog_controller" then
- v:SetKeyValue("fogend", globalFogDed - 150)
- v:SetKeyValue("fogstart", globalFogDed - 150)
- v:SetKeyValue("farz",globalFogDed)
- entFog = v
- break
- end
- end
- if not entFog then
- v = ents.Create( "env_fog_controller" )
- v:SetKeyValue("fogend", globalFogDed - 150 )
- v:SetKeyValue("fogstart", globalFogDed - 150)
- v:SetKeyValue("farz", globalFogDed)
- v:Spawn( )
- entFog = v
- end
- end
- hook.Add( "Initialize", "dedrussfpsfix", DedrussFPSfix );
- end
Advertisement
Add Comment
Please, Sign In to add comment