Garry's Mod Wiki


  hook.Remove( string eventName, any identifier )


Removes the hook with the supplied identifier from the given event.


1 string eventName
The event name.
2 any identifier
The unique identifier of the hook to remove, usually a string.


Darkens the player's screen for 15 seconds.

hook.Add( "HUDPaint", "my_hook_identifier", function() surface.SetDrawColor( 0, 0, 0, 150 ) surface.DrawRect( 0, 0, ScrW(), ScrH() ) end ) timer.Simple( 15, function() hook.Remove( "HUDPaint", "my_hook_identifier" ) end )
Output: After the hook gets removed, the dark overlay doesn't appear anymore.