bindEventHandler: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{ | {{ScriptItem2 | ||
| | |name = bindEventHandler | ||
|side = shared | |||
|type = function | |type = function | ||
| | |games = iii vc sa iv | ||
| | |desc = add a handler to call when an event occurs for the source item | ||
| | |arg1 = string eventName The name of the event, case-insensitive. | ||
| | |arg2 = handle source The source element. | ||
| | |arg3 = function handler The scripting function to call when the event occurs for the source element. | ||
| | |return = void | ||
|freturn = void | |||
|note = [[Server/Events|Server Events]]<br> | |||
| | |||
| | |||
[[Client/Events|Client Events]] | [[Client/Events|Client Events]] | ||
|cb3arg1 = Event event The event object. | |||
|cb3arg2 = ... vararg The arguments specific to the <code>eventName</code>. | |||
}} | }} |
Latest revision as of 20:36, 19 November 2022
Function
Server and Client
Online and Offline
Available since Server 1.0.0, Client 1.0.0
void bindEventHandler(string eventName, handle source, function handler)
The bindEventHandler function is used to add a handler to call when an event occurs for the source item.
Parameters
1) | string | eventName | The name of the event, case-insensitive. |
2) | handle | source | The source element. |
3) | function | handler | The scripting function to call when the event occurs for the source element. |
Return
void | This function doesn't return a value. |
Callbacks
function handler(Event event, ... vararg)
1) | Event | event | The event object. |
2) | ... | vararg | The arguments specific to the eventName .
|
Notes
Examples
There aren't any examples for this function.
Compatibility
There isn't any compatibility information for this function.
Related
Server Related
addEvent
addEventHandler
bindEventHandler
removeEventHandler
triggerEvent
triggerNetworkEvent
unbindEventHandler
Client Related
addEvent
addEventHandler
bindEventHandler
removeEventHandler
triggerEvent
triggerNetworkEvent
unbindEventHandler