Skip to content

addPedNativeDamageEvent

Client-side

Replay a server-approved native NPC hit on the victim client so GTA applies the health, armour, hit reaction, and fall response once.

Syntax

bool addPedNativeDamageEvent(player damagedPlayer, ped attackingPed, int weapon, int bodypart, int damageFactor, int direction, int token)

GTA task mapping

NATIVE GTA BEHAVIOR
No CTask is created

Submits GTA's native damage event on the victim owner so its stock calculator and physical response run in one place. There is no direct SCM opcode for the bridge.

Arguments

damagedPlayerplayer

Living local player whose client is authoritative for the physical damage.

attackingPedped

Different streamed script ped that produced the validated native hit.

weaponint

GTA weapon ID from 0 through 54.

bodypartint

0 for unknown, or an MTA body-part ID from torso through head.

damageFactorint

Raw native pre-calculator damage value from 1 through 10000.

directionint

Native local hit direction from 0 through 3.

tokenint

Active native event-profile observer token for the attacker.

Returns

true when the authenticated local-player damage event was accepted; false for invalid actors, values, ownership, streaming, or token state.

Ownership and lifecycle

Candidate queries create nothing. A multiplayer resource must validate each proposal, create and own the real NPCs and vehicles, assign one current syncer, handle ownership changes, and clean up every element. Native AI and event tokens belong to the calling resource and are revoked when that resource stops.

Important behavior
  • This is a low-level bridge for cross-owner native AI hits. A server should authenticate and relay the original attempt; calling it for an ordinary synchronized hit can apply damage twice.

Where this comes from

RELATED SA:O APIS

Continue exploring

Read the system guide →