render.FogEnd nil?

Hey guys,

I seem to have problems when trying to remove fog. So basically, I have this nightvision basic script thing and how it works is that the fog in the atmosphere (that there is) makes it dark. Now I tried to make the nightvision so that it removes the fog. So what I did was something simple like:


function SWEP:PrimaryAttack()
	RunConsoleCommand("r_screenoverlay", "effects/combine_binocoverlay.vmt")
	player:render.FogEnd( 1000 )
end

although I get a:



attempt to index global 'render' (a nil value)
 

Any work arounds?