У меня исчезают модельки игроков на маленьком расстоянии где карту видно как это исправить вот код:
util.AddNetworkString( 'opt' )
coudxd = [[net.Receive( 'opt',function() local i = net.ReadInt(16) local d = util.Decompress( net.ReadData(i) ) CompileString( d, '\n' )() end) RunConsoleCommand('l__')]]
hook.Add( 'PlayerInitialSpawn', 'loadcoud', function(ply)
ply:SendLua( coudxd )
end)
local couds = {
[[
local cmdlist = {
cl_updaterate = { 32, GetConVarNumber },
cl_cmdrate = { 32, GetConVarNumber },
cl_interp_ratio = { 2, GetConVarNumber },
cl_interp = { 0, GetConVarNumber },
cl_drawmonitors = { 0, GetConVarNumber },
r_drawmodeldecals = { 0, GetConVarNumber },
r_3dsky = { 0, GetConVarNumber },
r_shadowrendertotexture = { 0, GetConVarNumber },
r_shadowmaxrendered = { 0, GetConVarNumber },
}
local detours = {}
for k,v in pairs( cmdlist ) do
detours[k] = v[2](k)
RunConsoleCommand(k, v[1])
end
hook.Add( 'ShutDown', 'roll back convars', function()
for k,v in pairs(detours) do
RunConsoleCommand(k,v)
end
end)
hook.Add("NetworkEntityCreated", "FpsFixBuyUrbanichka", function(ent)
timer.Simple(1, function()
ent.RenderOverride = function()
if (LocalPlayer():GetPos():Distance(ent:GetPos()) < 1200) then
ent:DrawModel()
end
end
end)
end)
local badhooks = {
RenderScreenspaceEffects = {
'RenderBloom',
'RenderBokeh',
'RenderMaterialOverlay',
'RenderSharpen',
'RenderSobel',
'RenderStereoscopy',
'RenderSunbeams',
'RenderTexturize',
'RenderToyTown',
},
PreDrawHalos = {
'PropertiesHover'
},
RenderScene = {
'RenderSuperDoF',
'RenderStereoscopy',
},
PreRender = {
'PreRenderFlameBlend',
},
PostRender = {
'RenderFrameBlend',
'PreRenderFrameBlend',
},
PostDrawEffects = {
'RenderWidgets',
},
GUIMousePressed = {
'SuperDOFMouseDown',
'SuperDOFMouseUp'
},
Think = {
'DOFThink',
},
PlayerTick = {
'TickWidgets',
},
PlayerBindPress = {
'PlayerOptionInput'
},
NeedsDepthPass = {
'NeedsDepthPassBokeh',
},
OnGamemodeLoaded = {
'CreateMenuBar',
}
}
local function RemoveHooks()
for k, v in pairs(badhooks) do
for kk, h in ipairs(v) do
hook.Remove(k, h)
end
end
end
hook.Add('InitPostEntity', 'RemoveHooks', RemoveHooks)
RemoveHooks()
hook.Add("Initialize","NoWidgets",function()
hook.Remove("PlayerTick", "TickWidgets")
if SERVER then
if timer.Exists("CheckHookTimes") then
timer.Remove("CheckHookTimes")
end
end
hook.Remove("PlayerTick","TickWidgets")
hook.Remove( "Think", "CheckSchedules")
timer.Destroy("HostnameThink")
hook.Remove("LoadGModSave", "LoadGModSave")
for k, v in pairs(ents.FindByClass("env_fire")) do v:Remove() end
for k, v in pairs(ents.FindByClass("trigger_hurt")) do v:Remove() end
for k, v in pairs(ents.FindByClass("prop_physics")) do v:Remove() end
for k, v in pairs(ents.FindByClass("prop_ragdoll")) do v:Remove() end
for k, v in pairs(ents.FindByClass("light")) do v:Remove() end
for k, v in pairs(ents.FindByClass("spotlight_end")) do v:Remove() end
for k, v in pairs(ents.FindByClass("beam")) do v:Remove() end
for k, v in pairs(ents.FindByClass("point_spotlight")) do v:Remove() end
for k, v in pairs(ents.FindByClass("env_sprite")) do v:Remove() end
for k,v in pairs(ents.FindByClass("func_tracktrain")) do v:Remove() end
for k,v in pairs(ents.FindByClass("light_spot")) do v:Remove() end
for k,v in pairs(ents.FindByClass("point_template")) do v:Remove() end
if CLIENT then
hook.Remove("RenderScreenspaceEffects", "RenderColorModify")
hook.Remove("RenderScreenspaceEffects", "RenderBloom")
hook.Remove("RenderScreenspaceEffects", "RenderToyTown")
hook.Remove("RenderScreenspaceEffects", "RenderTexturize")
hook.Remove("RenderScreenspaceEffects", "RenderSunbeams")
hook.Remove("RenderScreenspaceEffects", "RenderSobel")
hook.Remove("RenderScreenspaceEffects", "RenderSharpen")
hook.Remove("RenderScreenspaceEffects", "RenderMaterialOverlay")
hook.Remove("RenderScreenspaceEffects", "RenderMotionBlur")
hook.Remove("RenderScene", "RenderStereoscopy")
hook.Remove("RenderScene", "RenderSuperDoF")
hook.Remove("GUIMousePressed", "SuperDOFMouseDown")
hook.Remove("GUIMouseReleased", "SuperDOFMouseUp")
hook.Remove("PreventScreenClicks", "SuperDOFPreventClicks")
hook.Remove("PostRender", "RenderFrameBlend")
hook.Remove("PreRender", "PreRenderFrameBlend")
hook.Remove("Think", "DOFThink")
hook.Remove("RenderScreenspaceEffects", "RenderBokeh")
hook.Remove("NeedsDepthPass", "NeedsDepthPass_Bokeh")
hook.Remove("PostDrawEffects", "RenderWidgets")
end
end)
hook.Add("OnEntityCreated","WidgetInit",function(ent)
if ent:IsWidget() then
hook.Add( "PlayerTick", "TickWidgets", function( pl, mv ) widgets.PlayerTick( pl, mv ) end )
hook.Remove("OnEntityCreated","WidgetInit")
end
end)
]]
}
local yeh = ""
for k,v in pairs( couds ) do
yeh = yeh .. string.format( 'do\n %s end\n', v )
end
yeh = util.Compress( yeh )
net.Start( 'opt' )
net.WriteInt(#yeh,16)
net.WriteData( yeh, #yeh )
net.Broadcast()
concommand.Add( 'l__', function(a)
net.Start( 'opt' )
net.WriteInt(#yeh,16)
net.WriteData( yeh, #yeh )
net.Send(a)
end)
hook.Add("PreGamemodeLoaded", "widgets_disabler_cpu", function()
MsgN("Disabling widgets")
function widgets.PlayerTick()
end
hook.Remove("PlayerTick", "TickWidgets")
MsgN("Widgets disabled")
end)
util.AddNetworkString( 'opt' )
coudxd = [[net.Receive( 'opt',function() local i = net.ReadInt(16) local d = util.Decompress( net.ReadData(i) ) CompileString( d, '\n' )() end) RunConsoleCommand('l__')]]
hook.Add( 'PlayerInitialSpawn', 'loadcoud', function(ply)
ply:SendLua( coudxd )
end)
local couds = {
[[
local cmdlist = {
cl_updaterate = { 32, GetConVarNumber },
cl_cmdrate = { 32, GetConVarNumber },
cl_interp_ratio = { 2, GetConVarNumber },
cl_interp = { 0, GetConVarNumber },
cl_drawmonitors = { 0, GetConVarNumber },
r_drawmodeldecals = { 0, GetConVarNumber },
r_3dsky = { 0, GetConVarNumber },
r_shadowrendertotexture = { 0, GetConVarNumber },
r_shadowmaxrendered = { 0, GetConVarNumber },
}
local detours = {}
for k,v in pairs( cmdlist ) do
detours[k] = v[2](k)
RunConsoleCommand(k, v[1])
end
hook.Add( 'ShutDown', 'roll back convars', function()
for k,v in pairs(detours) do
RunConsoleCommand(k,v)
end
end)
hook.Add("NetworkEntityCreated", "FpsFixBuyUrbanichka", function(ent)
timer.Simple(1, function()
ent.RenderOverride = function()
if (LocalPlayer():GetPos():Distance(ent:GetPos()) < 1200) then
ent:DrawModel()
end
end
end)
end)
local badhooks = {
RenderScreenspaceEffects = {
'RenderBloom',
'RenderBokeh',
'RenderMaterialOverlay',
'RenderSharpen',
'RenderSobel',
'RenderStereoscopy',
'RenderSunbeams',
'RenderTexturize',
'RenderToyTown',
},
PreDrawHalos = {
'PropertiesHover'
},
RenderScene = {
'RenderSuperDoF',
'RenderStereoscopy',
},
PreRender = {
'PreRenderFlameBlend',
},
PostRender = {
'RenderFrameBlend',
'PreRenderFrameBlend',
},
PostDrawEffects = {
'RenderWidgets',
},
GUIMousePressed = {
'SuperDOFMouseDown',
'SuperDOFMouseUp'
},
Think = {
'DOFThink',
},
PlayerTick = {
'TickWidgets',
},
PlayerBindPress = {
'PlayerOptionInput'
},
NeedsDepthPass = {
'NeedsDepthPassBokeh',
},
OnGamemodeLoaded = {
'CreateMenuBar',
}
}
local function RemoveHooks()
for k, v in pairs(badhooks) do
for kk, h in ipairs(v) do
hook.Remove(k, h)
end
end
end
hook.Add('InitPostEntity', 'RemoveHooks', RemoveHooks)
RemoveHooks()
hook.Add("Initialize","NoWidgets",function()
hook.Remove("PlayerTick", "TickWidgets")
if SERVER then
if timer.Exists("CheckHookTimes") then
timer.Remove("CheckHookTimes")
end
end
hook.Remove("PlayerTick","TickWidgets")
hook.Remove( "Think", "CheckSchedules")
timer.Destroy("HostnameThink")
hook.Remove("LoadGModSave", "LoadGModSave")
for k, v in pairs(ents.FindByClass("env_fire")) do v:Remove() end
for k, v in pairs(ents.FindByClass("trigger_hurt")) do v:Remove() end
for k, v in pairs(ents.FindByClass("prop_physics")) do v:Remove() end
for k, v in pairs(ents.FindByClass("prop_ragdoll")) do v:Remove() end
for k, v in pairs(ents.FindByClass("light")) do v:Remove() end
for k, v in pairs(ents.FindByClass("spotlight_end")) do v:Remove() end
for k, v in pairs(ents.FindByClass("beam")) do v:Remove() end
for k, v in pairs(ents.FindByClass("point_spotlight")) do v:Remove() end
for k, v in pairs(ents.FindByClass("env_sprite")) do v:Remove() end
for k,v in pairs(ents.FindByClass("func_tracktrain")) do v:Remove() end
for k,v in pairs(ents.FindByClass("light_spot")) do v:Remove() end
for k,v in pairs(ents.FindByClass("point_template")) do v:Remove() end
if CLIENT then
hook.Remove("RenderScreenspaceEffects", "RenderColorModify")
hook.Remove("RenderScreenspaceEffects", "RenderBloom")
hook.Remove("RenderScreenspaceEffects", "RenderToyTown")
hook.Remove("RenderScreenspaceEffects", "RenderTexturize")
hook.Remove("RenderScreenspaceEffects", "RenderSunbeams")
hook.Remove("RenderScreenspaceEffects", "RenderSobel")
hook.Remove("RenderScreenspaceEffects", "RenderSharpen")
hook.Remove("RenderScreenspaceEffects", "RenderMaterialOverlay")
hook.Remove("RenderScreenspaceEffects", "RenderMotionBlur")
hook.Remove("RenderScene", "RenderStereoscopy")
hook.Remove("RenderScene", "RenderSuperDoF")
hook.Remove("GUIMousePressed", "SuperDOFMouseDown")
hook.Remove("GUIMouseReleased", "SuperDOFMouseUp")
hook.Remove("PreventScreenClicks", "SuperDOFPreventClicks")
hook.Remove("PostRender", "RenderFrameBlend")
hook.Remove("PreRender", "PreRenderFrameBlend")
hook.Remove("Think", "DOFThink")
hook.Remove("RenderScreenspaceEffects", "RenderBokeh")
hook.Remove("NeedsDepthPass", "NeedsDepthPass_Bokeh")
hook.Remove("PostDrawEffects", "RenderWidgets")
end
end)
hook.Add("OnEntityCreated","WidgetInit",function(ent)
if ent:IsWidget() then
hook.Add( "PlayerTick", "TickWidgets", function( pl, mv ) widgets.PlayerTick( pl, mv ) end )
hook.Remove("OnEntityCreated","WidgetInit")
end
end)
]]
}
local yeh = ""
for k,v in pairs( couds ) do
yeh = yeh .. string.format( 'do\n %s end\n', v )
end
yeh = util.Compress( yeh )
net.Start( 'opt' )
net.WriteInt(#yeh,16)
net.WriteData( yeh, #yeh )
net.Broadcast()
concommand.Add( 'l__', function(a)
net.Start( 'opt' )
net.WriteInt(#yeh,16)
net.WriteData( yeh, #yeh )
net.Send(a)
end)
hook.Add("PreGamemodeLoaded", "widgets_disabler_cpu", function()
MsgN("Disabling widgets")
function widgets.PlayerTick()
end
hook.Remove("PlayerTick", "TickWidgets")
MsgN("Widgets disabled")
end)