onPedInflictDamage

From GTA Connected
Revision as of 00:58, 22 April 2021 by Mex (talk | contribs)
Jump to navigation Jump to search

Event Client Only icon-iii.png icon-vc.png icon-sa.png icon-iv.png Online and Offline Cancellable

Available since Client 1.0.0

function(Event event, Ped ped, Entity responsibleEntity, int weapon, float loss, int pedPiece)

The onPedInflictDamage event is invoked when a ped is damaged.

Parameters

1) Event event The event object for this event.
2) Ped ped The ped that has been damaged.
3) Entity responsibleEntity The entity that is responsible for the damage.
4) int weapon The weapon ID for the damage.
5) float loss The ped health lost for the damage.
6) int pedPiece The ped piece ID for the damage.

Attributes

cancellable This event can be cancelled, by using event.preventDefault.

Notes

There aren't any notes for this event.

Examples

Example 1 - JavaScript - Client-Side:

addEventHandler('onPedInflictDamage', function(event, ped, responsibleEntity, weapon, loss, pedPiece) { // Prevent the ped from being damaged. event.preventDefault(); });

Compatibility

There isn't any compatibility information for this event.

Related

Client Related

icon-iii.png icon-vc.png icon-sa.png OnPedBusted
icon-iii.png icon-vc.png icon-sa.png OnPedChangeWeapon
icon-iii.png icon-vc.png icon-sa.png OnPedCrouch
icon-iii.png icon-vc.png icon-sa.png icon-iv.png OnPedDead
icon-vc.png OnPedEnteredVehicle
icon-iii.png icon-vc.png icon-sa.png OnPedEnteringVehicle
icon-iii.png icon-vc.png icon-sa.png OnPedEnterVehicle
icon-vc.png OnPedExitedVehicle
icon-iii.png icon-vc.png icon-sa.png OnPedExitingVehicle
icon-iii.png icon-vc.png icon-sa.png OnPedExitVehicle
icon-iii.png icon-vc.png icon-sa.png OnPedFall
icon-iii.png icon-vc.png icon-sa.png OnPedFireProjectile
icon-iii.png icon-vc.png icon-sa.png OnPedInflictDamage
icon-iii.png icon-vc.png icon-sa.png OnPedJump
icon-iii.png icon-vc.png icon-sa.png icon-iv.png OnPedSpawn
icon-vc.png OnPedStartClosingVehicleDoor
icon-iii.png icon-vc.png icon-sa.png OnPedStartFightAttack
icon-iii.png icon-vc.png icon-sa.png OnPedStartFightDefend
icon-vc.png OnPedStartOpeningVehicleDoor
icon-iii.png icon-vc.png icon-sa.png OnPedUncrouch
icon-iii.png icon-vc.png icon-sa.png OnPedUseWeapon
icon-iii.png icon-vc.png icon-sa.png icon-iv.png OnPedWasted