Remove hl2 "damage effect"?

Is there a way to remove the viewpunch and the red screen when getting damaged?

Thanks in advance.

Check this page, it might be here: http://wiki.garrysmod.com/page/HUD_Element_List

I think “CHudDamageIndicator” is only for the red bar which shows you were the hit came from, but I am not 100% sure so I will check it out.

Thanks for reply. :slight_smile:

It just removed the red bars which shows the direction where the hit came from and the red screen.
The viewpunch is still there. :frowning:

Any other ideas?

Perhaps override a hook that determines whether or not to take damage. You could return false but manually set the player’s deducted health and check for <0 to kill.

That could work but are you sure this is a good Idea?
Well, I guess it would break other addons.

bumb

For the viewpunch it might be CalcView

What exactly is your idea?
How can I affect the viewpunch when getting damaged with the CalcView hook?

I think he meant something like this:



hook.Add( "CalcView", "NoPunch", function( ply, pos, angles, fov )
	local view = {}
	local ang = LocalPlayer():GetViewPunchAngles()
	if ang.y==0 or ang.p==0 then return end
	
	view.origin = pos
	view.angles = Angle(angles.p-ang.p,angles.y-ang.y,angles.r-ang.r)
	view.fov = fov

	return view
end)


A better way would be (In theory):



hook.Add("Think","NoPunch",function()
	local ang = LocalPlayer():GetViewPunchAngles()
	if ang.y!=0 or ang.p!=0 then LocalPlayer():ViewPunchReset() end
end)