EntityDestroyed

From RAGE Multiplayer Wiki
Jump to navigation Jump to search

Event triggered when an entity is destroyed

Server-Side
Event

Js.png JavaScript



JavaScript Syntax
Jslogo.png

Parameters

  • entity: Entity

Example

mp.events.add("entityDestroyed", entity => {
  // Do what you want
});


Client-Side
Event

C.png C#




C# Syntax
C.png

public delegate void OnEntityDestroyedDelegate(Entity entity);

Parameters

  • entity - the destroyed entity, expects RAGE.Elements.Entity

Example

The example below sends a message to client when an entity is destoryed, showing the entity model, position and remoteId.

Events.OnEntityDestroyed += OnEntityDestroyed;
public void OnEntityDestroyed(RAGE.Elements.Entity entity)
{
   RAGE.Chat.Output($"{entity.Model} destroyed at {entity.Position} with serverside id:{entity.RemoteId}");
}


See also