Events::call

From RAGE Multiplayer Wiki
Revision as of 15:24, 27 July 2018 by Wolfy (talk | contribs)

This function calls registered event handlers.

Syntax

//CLIENTSIDE
events.call(eventName, ...args);
//SERVERSIDE
events.call(eventName, ...args);

Calling from serverside to clientside requires args to be enclosed in []. Calling serverside to serverside, or clientside to clientside does not require this.

Example

mp.events.add(
{
    "anyCallbackName" : anything =>
    {
         console.log(anything);
    }
});

mp.events.call("anyCallbackName", "yea");

See Also