addPedNativeDamageResponseEvent
Replays GTA's civilian damage decision on the authoritative owner without applying physical damage again.
Syntax
bool addPedNativeDamageResponseEvent(ped thePed, ped attacker, int weapon, int bodypart, int token)GTA task mapping
Submits a behavior-only CEventDamage through CEventGroup::Add. GTA chooses the response task; there is no direct SCM opcode for this bridge.
Arguments
thePedpedLiving script ped that owns the active ambient-wander profile on this client.
attackerpedDifferent streamed ped or player responsible for the already synchronized hit.
weaponintMTA weapon ID from unarmed through fall.
bodypartint0 for unknown, or an MTA body-part ID from torso through head.
tokenintResource-private ambient-wander token for the target ped.
Returns
true when GTA accepted the behavior-only event; false for invalid arguments, a stale or foreign token, an observer client, a dead or unstreamed target, or a missing native attacker.
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.
- Call this only after MTA has synchronized the real hit and only when the owner's ordinary native damage event was absent.
- The replay carries no physical damage, so it can select a stock fall, recovery, flee, cower, or fight response without reducing health twice.
Where this comes from
Continue exploring
← Back to the SA:O Lua API · How Synchronized NPCs and road traffic works →