EntityDestroyed

From RAGE Multiplayer Wiki
Revision as of 11:01, 30 April 2019 by RoboN1X (talk | contribs) (category)

Event triggered when an entity is destroyed

Server-Side
Event

 C#  JavaScript



JavaScript Syntax

Parameters

  • entity

Example

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


Client-Side
Event

 C#



C# Syntax

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}");
}