ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. getEventHandlers

Function

getEventHandlers

Server and clientEventsIdentical to MTA:SA

Returns the list of functions attached to an event directly on the given element (without handlers on parents).

Syntax

table getEventHandlers(string eventName, element attachedTo)

Arguments

eventNamestring
Event name.
attachedToelement
The element.

Returns

A table of functions (empty when nothing is attached).

Example

for _, fn in ipairs(getEventHandlers("onPlayerJoin", root)) do
    removeEventHandler("onPlayerJoin", root, fn)
end

See also