- Documentation
- Shared functions
- isEventAdded
Function
isEventAdded
Checks whether an event with this name exists (built in or added with addEvent).
Syntax
bool isEventAdded(string eventName)Arguments
eventNamestring- Event name.
Returns
true when it exists.
Example
if not isEventAdded("onJobFinished") then addEvent("onJobFinished") end
See also
addEventRegisters a custom event with the given name so it can be triggered (triggerEvent,triggerClientEvent,triggerServerEvent) and handled (addEventHandler). WithallowRemoteTrigger = truethe event can come from the other side of the network: on the server - from a client viatriggerServerEvent, on the client - from the server viatriggerClientEvent. Without it, events from the network are rejected, which protects the server from clients faking events.getEventNamesReturns a sorted list of the names of all known events: built-in ones and those registered withaddEvent.