Events::Event: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
No edit summary
Line 1: Line 1:
__TOC__
{{SharedFunctionJS}}
{{SharedFunctionJS}}


===Description===
OOP constructor of [[Events::add|Events' add]] function
OOP constructor of [[Events::add|Events' add]] function


{{JSContainer|
===Syntax===
===Syntax===


Line 17: Line 19:


===Example===
===Example===
<syntaxhighlight lang="javascript">
<pre>
let ev = new mp.Event("playerDeath", (player, reason, killer) =>
let ev = new mp.Event("playerDeath", (player, reason, killer) =>
{
{
Line 24: Line 26:
});
});
ev.destroy(); // due to this line the event is never going to be executed if we call this before it
ev.destroy(); // due to this line the event is never going to be executed if we call this before it
</syntaxhighlight>
</pre>
}}
 
==See Also==
{{Event_functions}}

Revision as of 11:37, 3 December 2019