Explosion
Tip
This event is available on server-side only
This event is called each time entity enters or leaves a checkpoint.
Parameter | Description |
---|---|
player | Player who caused the explosion. |
explosionType | The type of explosion. See: ExplosionType |
position | Position of th explosion. |
explosionFx | Hash of the fx effect of the explosion. |
targetEntity | The entity that was destroyed/hit. (e.g. Vehicle) |
Normal event handler
Alt.OnExplosion += (player, explosionType, position, explosionFx, targetEntity) => {
// ...
return true; // false will cancel the event sync
}
Attribute event handler
Warning
Attribute event handlers only work in Scripts, or after executing Alt.RegisterEvents on a class instance.
For more info see: Create script
public class MyScript : IScript
{
[ScriptEvent(ScriptEventType.Explosion)]
public void OnExplosion(IPlayer player, ExplosionType explosionType, Position position, uint explosionFx, IEntity targetEntity)
{
// ...
}
}