RemoveDebugHook

From Multi Theft Auto: Wiki
Revision as of 05:44, 24 November 2013 by Ccw (talk | contribs) (Created page with "__NOTOC__ {{Server function}} {{New feature/item|3.0136|1.3|5939| This function removes hooks added by addDebugHook }} ==Syntax== <syntaxhighlight lang="lua"> bool removeDebugHook( string hoo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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 : The callback function to remove

Returns

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

Example

This example adds a hook, then removes it:

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

Requirements

Minimum server version 1.3.4-9.05939
Minimum client version n/a

Note: Using this feature requires the resource to have the above minimum version declared in the meta.xml <min_mta_version> section. e.g. <min_mta_version server="1.3.4-9.05939" />

See Also