AddEvent: Difference between revisions

From Onset Developer Wiki
No edit summary
No edit summary
Line 1: Line 1:
{{Info|Function|Server & Client|1.0}}
{{Info|Function|Server & Client|1.0}}


{{FuncDescription|__EDIT_ME__}}
{{FuncDescription|Adds a function as event handler which will be called when a certain event occurs. Multiple functions can be bound to a single event.}}


{{FuncSyntax|AddEvent(EventName, LuaFunction [, OptionalBindId])}}
{{FuncSyntax|AddEvent(EventName, LuaFunction)}}


{{FuncParameters}}
{{FuncParameters}}
{{FuncParam|EventName|__EDIT_ME__}}
{{FuncParam|EventName|The name of the event. See [[Template:ServerEvents|ServerEvents]] or [[Template:ServerEvents|ClientEvents]] for a list of events.}}
{{FuncParam|LuaFunction |__EDIT_ME__}}
{{FuncParam|LuaFunction |The function which will be called when the event occurs.}}
{{FuncParamOptional|OptionalBindId|__EDIT_ME__}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|__EDIT_ME__}}

Revision as of 19:19, 22 March 2019

AddEvent

Type: Function
Context: Server & Client
Introduced: v1.0

Description

Adds a function as event handler which will be called when a certain event occurs. Multiple functions can be bound to a single event.

Syntax

AddEvent(EventName, LuaFunction)

Parameters

  • EventName
    The name of the event. See ServerEvents or ClientEvents for a list of events.
  • LuaFunction
    The function which will be called when the event occurs.

Return Value

  • __EDIT_ME__

Example

__EDIT_ME__

See also

__EDIT_ME__