RemoveDebugHook: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(Remove obsolete Requirements section)
 
Line 31: Line 31:
{{ChangelogHeader}}
{{ChangelogHeader}}
{{ChangelogItem|1.3.5-9.06054|Added clientside}}
{{ChangelogItem|1.3.5-9.06054|Added clientside}}
==Requirements==
{{Requirements|1.3.4-9.05939|1.3.5-9.06054}}


==See Also==
==See Also==
{{Utility functions}}
{{Utility functions}}

Latest revision as of 17:12, 7 November 2024

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 )

Changelog

Version Description
1.3.5-9.06054 Added clientside

See Also