Garry's Mod Wiki



boolean WEAPON:DoDrawCrosshair( number x, number y )


Called when the crosshair is about to get drawn, and allows you to override it.

This function will not be called if SWEP.DrawCrosshair set to false.
This function will not be called if player was affected by Player:CrosshairDisable.
The arguments passed to this function are not affected by SWEP.AccurateCrosshair.

Issue Tracker: 2117


1 number x
X coordinate of the crosshair.
2 number y
Y coordinate of the crosshair.


1 boolean
Return true to override the default crosshair.


Draws an outlined rectangle in place of the crosshair.

function SWEP:DoDrawCrosshair( x, y ) surface.SetDrawColor( 0, 250, 255, 255 ) surface.DrawOutlinedRect( x - 32, y - 32, 64, 64 ) return true end

Special Pages



Render Time: 45ms

DB GetPage 3
Generate Html 4
SaveChanges (1) 29
Render Body 0
Render Sidebar 7