SixL server API / events / EventMpConstructor
Interface: EventMpConstructor
The constructor mp.Event.
Constructors
Constructor
new EventMpConstructor<K>(eventName,callback):EventMp
Registers a handler at once (the same as mp.events.add(eventName, callback)) and returns a handle to remove it.
Parameters
eventName
K
The event name.
callback
The handler.
Returns
Example
const ev = new mp.Event('playerChat', (player, text) => { });
Constructor
new EventMpConstructor(eventName,callback):EventMp
Registers a handler for any event name.
Parameters
eventName
string
The event name.
callback
(...args) => void
The handler.
Returns
Example
const ev = new mp.Event('myEvent', (...args) => { });