RemoveEventHandler: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 5: Line 5:
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool removeEventHandler ( string eventName, element attachedTo, function functionName )  
bool removeEventHandler ( string eventName, element attachedTo, function functionVar )  
</syntaxhighlight>  
</syntaxhighlight>  


Line 11: Line 11:
*'''eventName:''' The name of the [[event]] you want to detach the handler function from.
*'''eventName:''' The name of the [[event]] you want to detach the handler function from.
*'''attachedTo:''' The [[element]] the handler was attached to.
*'''attachedTo:''' The [[element]] the handler was attached to.
*'''functionName:''' The handler function that was attached.
*'''functionVar:''' The handler function that was attached.


===Returns===
===Returns===
Line 17: Line 17:


==Example==
==Example==
 
This page does not have an example.
<syntaxhighlight lang="lua">
--add an example here
</syntaxhighlight>


==See Also==
==See Also==
{{Event_functions}}
{{Event_functions}}
[[Category:Incomplete]]
[[Category:Needs_Example]]

Revision as of 15:42, 30 August 2007

This functions removes a handler function from an event, so that the function is not called anymore when the event is triggered. See event system for more information on how the event system works.

Syntax

bool removeEventHandler ( string eventName, element attachedTo, function functionVar ) 

Required Arguments

  • eventName: The name of the event you want to detach the handler function from.
  • attachedTo: The element the handler was attached to.
  • functionVar: The handler function that was attached.

Returns

Returns true if the event handler was removed successfully. Returns false if the specified event handler could not be found or invalid parameters were passed.

Example

This page does not have an example.

--add an example here

See Also