Skip to content

PlayerHitEntityPayload

What playerHitEntity gets: the payload a handler receives.

Renamed in 0.28 from HitPayload; see renamed names.

type PlayerHitEntityPayload = {
attacker: PlayerSnapshot | null;
victim: PlayerSnapshot | null;
attackerNetworkId: number;
victimNetworkId: number;
targetSeat: number | null;
weapon: number;
impactIntensity: number;
hitKind: "damage" | "runOver";
provenance: "client-report";
};
Field Type Description
attacker PlayerSnapshot or null The player who hit, when the hitting entity is that player’s ped or the car they drive; otherwise null.
victim PlayerSnapshot or null The player who was hit, the same way; null for an NPC or an empty car.
attackerNetworkId number The hitting entity’s network ID.
victimNetworkId number The network ID of what was hit; a vehicle’s ID for the NPCs in it.
targetSeat number | null null for the entity itself; for an NPC in a vehicle, its seat: 0 the driver, 1-3 a passenger. Always null for a player.
weapon number The weapon type.
impactIntensity number How hard the hit was: for damage the game’s damage before armour (at most 1100), for runOver how hard the car struck (at most 1000). Not the health lost; see playerHealthOrArmourDecreased.
hitKind "damage" | "runOver" A hit, or being run over.
provenance "client-report" The hitter’s game says so; the server doesn’t prove it.