OnPedInflictDamage: Difference between revisions
No edit summary |
No edit summary |
||
Line 11: | Line 11: | ||
|parameter5 = int pedPiece The ped piece ID for the damage. | |parameter5 = int pedPiece The ped piece ID for the damage. | ||
|cancellable = true | |cancellable = true | ||
|exampleJSCS = addEventHandler('onPedInflictDamage', function(event, ped, responsibleEntity, weapon, loss, pedPiece) | |||
{ | |||
// Prevent the ped from being damaged. | |||
event.preventDefault(); | |||
}); | |||
}} | }} |
Revision as of 00:58, 22 April 2021
Event
Client Only
Online and Offline
Cancellable
function(Event event, Ped ped, Entity responsibleEntity, int weapon, float loss, int pedPiece)
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
OnPedBusted
OnPedChangeWeapon
OnPedCrouch
OnPedDead
OnPedEnteredVehicle
OnPedEnteringVehicle
OnPedEnterVehicle
OnPedExitedVehicle
OnPedExitingVehicle
OnPedExitVehicle
OnPedFall
OnPedFireProjectile
OnPedInflictDamage
OnPedJump
OnPedSpawn
OnPedStartClosingVehicleDoor
OnPedStartFightAttack
OnPedStartFightDefend
OnPedStartOpeningVehicleDoor
OnPedUncrouch
OnPedUseWeapon
OnPedWasted