AddEventHandler
Adds an event handler to the provided event.
Syntax
AddEventHandler event_name callback
Arguments
| Name | Required | Type | Description |
|---|---|---|---|
event name | Yes | An in-game event e.g. RoundStarted (found using command 'serhelp events') | |
callback | Yes | A name of a function defined above e.g. MyFunction |
Details
This is a simplified version of the event handling system. It is recommended to use the '!-- OnEvent' flag when possible. Additionally, the variables are NOT going to be added via the arguments defined on the function, but automatically (like in the '!-- OnEvent' flag) - this is due to a technical limitation.
On a running server
Use serhelp AddEventHandler to inspect the reference generated by your installed SER version.