removeDebugHook | Multi Theft Auto: Wiki Skip to content

removeDebugHook

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function removes hooks added by addDebugHook

Syntax

bool removeDebugHook ( string hookType, function callbackFunction )
Required Arguments
  • hookType: The type of hook to remove. This can be: preEvent postEvent preFunction postFunction
  • callbackFunction: MISSING_PARAM_DESC

Returns

  • bool: value

Returns true if the hook was successfully removed, or false otherwise.

Code Examples

shared

This example adds a hook, then removes it:

function onPreEvent( sourceResource, eventName, eventSource, eventClient, luaFilename, luaLineNumber, ... )
end
addDebugHook( "preEvent", onPreEvent )
removeDebugHook( "preEvent", onPreEvent )