|
|
| (One intermediate revision by one other user not shown) |
| Line 1: |
Line 1: |
| − | ==unregisterEventHandler==
| + | #REDIRECT [[Global Command: unregisterEventHandler]] |
| − | | |
| − | <div class="command-min-version-info">Available since: <span class="command-min-version">v3.8</span></div>
| |
| − | | |
| − | <div class="command-doc">Unregisters an event handler function for a specific event.</div>
| |
| − | | |
| − | Lua Syntax:
| |
| − | <pre class="command-syntax">unregisterEventHandler(event, eventHandler)</pre>
| |
| − | ===Arguments===
| |
| − | ====event====
| |
| − | :'''"string"''' - The event which triggers the event handler to be called. Currently supported events: "mainLoop".
| |
| − | ====eventHandler====
| |
| − | :'''"string"''' - The name of the lua function which is called when the event occurs.
| |
| − | ===Flags===
| |
| − | ===Return Values===
| |
| − | None.
| |
| − | ===Examples===
| |
| − | Example 1: mainLoop
| |
| − | <syntaxhighlight>
| |
| − | function onMainLoop()
| |
| − | -- do something
| |
| − | end
| |
| − | | |
| − | registerEventHandler("mainLoop", "onMainLoop")unregisterEventHandler("mainLoop", "onMainLoop")
| |
| − | </syntaxhighlight>
| |
| − | [[Category:Player Commands]] | |