Garry's Mod Wiki


  boolean GM:HUDShouldDraw( string name )


Called when the Gamemode is about to draw a given element on the client's HUD (heads-up display).

This hook is called HUNDREDS of times per second (more than 5 times per frame on average). You shouldn't be performing any computationally intensive operations.


1 string name
The name of the HUD element. You can find a full list of HUD elements for this hook here.


1 boolean
Return false to prevent the given element from being drawn on the client's screen.


Hides the default health and battery (armor) HUD elements, while still allowing the display of other elements to be controlled by other addons.

local hide = { ["CHudHealth"] = true, ["CHudBattery"] = true } hook.Add( "HUDShouldDraw", "HideHUD", function( name ) if ( hide[ name ] ) then return false end -- Don't return anything here, it may break other addons that rely on this hook. end )