Garry's Mod Wiki

Garry's Mod Wiki

  hook.Remove( string eventName, any identifier )

Description

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

Arguments

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

Example

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.

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...