Events::remove

From RAGE Multiplayer Wiki
Jump to navigation Jump to search

Server-Side
Function

Js.png JavaScript



Removes the specified event from events tree.

Syntax

mp.events.remove("eventName"); // Removes all eventName instances
mp.events.remove("eventName", functionInstance); // Removes specified event instance.
mp.events.remove(["eventName1", "eventName2"]); // Removes all specified events instances.

Example

Server-Side
function onPlayerDeath(player, reason, killer){
  console.log(player.name + " died.");
  mp.events.remove("playerDeath", onPlayerDeath); // Once someone died, remove the event.
}
mp.events.add("playerDeath", onPlayerDeath);

See Also