MeleeActionDamage: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
(added example to disable instant kill)
 
Line 21: Line 21:
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
mp.events.add('meleeActionDamage', (source, target, weaponHash, damage, isCritical) => {
mp.events.add('meleeActionDamage', (source, target, weaponHash, damage, isCritical) => {
    if (isCritical) {
if (damage >= 500) { //disable instant 'stealth' kill
        mp.console.logInfo(`${target.name} got critically wounded by ${source.name}.`);
return true;
    }
}
});
});
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 20:54, 9 May 2024

Client-Side
Function

 JavaScript



JavaScript Syntax


Parameters

  • source: Object
  • target: Object
  • weaponHash: number
  • damage: number
  • isCritical: boolean

Return value

  • void

Syntax

mp.events.add('meleeActionDamage', (source, target, weaponHash, damage, isCritical) => {});

Example

mp.events.add('meleeActionDamage', (source, target, weaponHash, damage, isCritical) => {
	if (damage >= 500) { //disable instant 'stealth' kill
		return true;
	}
});


See Also

Browser

Checkpoints

Colshapes

Console

Common

Damage

Vehicles

Voice chat

Streaming

Graphics

Waypoint

Misc