OnPedInflictDamage: Difference between revisions
No edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
{{ | {{ScriptItem2 | ||
| | |name = onPedInflictDamage | ||
|side = client | |||
|type = event | |type = event | ||
| | |games = iii vc sa | ||
| | |desc = a ped is damaged | ||
| | |arg1 = Ped ped The ped that has been damaged. | ||
|arg2 = Entity responsibleEntity The entity that is responsible for the damage. | |||
| | |arg3 = int weapon The weapon ID for the damage. | ||
| | |arg4 = float loss The ped health lost for the damage. | ||
| | |arg5 = int pedPiece The ped piece ID for the damage. | ||
| | |cancel = true | ||
| | |||
|exampleJSCS = addEventHandler('onPedInflictDamage', function(event, ped, responsibleEntity, weapon, loss, pedPiece) | |exampleJSCS = addEventHandler('onPedInflictDamage', function(event, ped, responsibleEntity, weapon, loss, pedPiece) | ||
{ | { |
Latest revision as of 22:51, 24 August 2023
Event
Client Only
Online and Offline
Cancellable
onPedInflictDamage(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