OutgoingDamage

From RAGE Multiplayer Wiki

Client-Side Event

 C#  JavaScript


Triggered upon damage that an entity is about to give another entity.

This event is also cancellable.

JavaScript Syntax

Parameters

  • sourceEntity: Object
  • targetEntity: Object
  • sourcePlayer: Object
  • weapon: Int
  • boneIndex: Int
  • damage: Int

Example

Client-Side
mp.events.add('outgoingDamage', (sourceEntity, targetEntity, sourcePlayer, weapon, boneIndex, damage) => {
    if (targetEntity.type === 'player' && boneIndex === 20) {
        return true; // disable outgoing headshot damage
    }
});


C# Syntax

Parameters

  • sourceEntity: Entity - entity who received the damage.
  • targetEntity: Entity - entity who dealt the damage.
  • sourcePlayer: Player - player who received the damage.
  • weapon: UInt64 - weapon which did the damage.
  • boneIndex: UInt64 - hit BoneIndex (not the BoneId!)
  • damage: Int - damage it will deal (if not canceled)
  • cancel: CancelEventArgs - cancel to disable the damage.

Example

Client-Side
public MyClass() 
{
    OnOutgoingDamage += OnOutgoingDamageHandler;
}

private void OnOutgoingDamageHandler(Entity sourceEntity, Entity targetEntity, Player sourcePlayer, ulong weaponHash, ulong boneIdx, int damage, CancelEventArgs cancel)
{
    // Disable outgoing headshot damage
    if (target.Type == EntityType.Player && boneIdx.Equals(20)) 
    {
        cancel.Cancel = true;
        return;
    }
}


See Also

Browser

Checkpoints

Colshapes

Console

Common

Damage

Vehicles

Voice chat

Streaming

Graphics

Waypoint

Misc