Lua Passive Anti Screengrab
Code:
local fakeRT = GetRenderTarget( "fakeRT" .. os.time(), ScrW(), ScrH() )
hook.Add( "RenderScene", "AntiScreenGrab", function( vOrigin, vAngle, vFOV )
local view = {
x = 0,
y = 0,
w = ScrW(),
h = ScrH(),
dopostprocess = true,
origin = vOrigin,
angles = vAngle,
fov = vFOV,
drawhud = true,
drawmonitors = true,
drawviewmodel = true
}
render.RenderView( view )
render.CopyTexture( nil, fakeRT )
cam.Start2D()
hook.Run( "CheatHUDPaint" )
cam.End2D()
render.SetRenderTarget( fakeRT )
return true
end )
hook.Add( "ShutDown", "RemoveAntiScreenGrab", function()
render.SetRenderTarget()
end )
Makes you basically impossible to screengrab, change your HUDPaints to CheatHUDPaint.
Test:
Code:
hook.Add( "CheatHUDPaint", "test", function()
surface.SetDrawColor( color_white )
surface.DrawRect( 0, 0, 100, 100 )
end )
hook.Add( "HUDPaint", "test", function()
surface.SetDrawColor( Color( 255, 0, 0 ) )
surface.DrawRect( 100, 0, 100, 100 )
end )
What screengrab sees:
What you see:
