EntityDestroyed
Jump to navigation
Jump to search
Event triggered when an entity is destroyed
Contents
Server-Side Event
JavaScript Syntax
Parameters
- entity: Entity
Example
mp.events.add("entityDestroyed", entity => {
// Do what you want
});
Client-Side Event
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}");
}