ScrW problem

The ScrW code just causes an error in console, was there an update, or is there a way of somehow avoiding it.

ScrW()

thats what i used sorry.

function SWEP:Crosshair(gap, length)
–gets the center of the screen
local x = ScrW() / 2.0
local y = ScrH() / 2.0

–set the drawcolor
surface.SetDrawColor( 0, 255, 0, 255 )

--draw the crosshair
surface.DrawLine( x - length, y, x - gap, y )
surface.DrawLine( x + length, y, x + gap, y )
surface.DrawLine( x, y - length, x, y - gap )
surface.DrawLine( x, y + length, x, y + gap )

end

is what i did

And the error is?

weapons/cinders/shared.lua:114: attempt to call global ‘ScrW’ (a nil value)

Add if SERVER then return end to the top of the function.

Thanks!