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
The model-residency pass retains GTA's eight stock zone-ped slots until reset or game teardown. Candidate queries create no element; a multiplayer resource must validate proposals, create and own peds, assign one syncer, advance owner epochs, and clean up every element. Native-event tokens belong to the calling resource, activate only on the current syncer, and are revoked on resource shutdown.
- 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 Neon Lua API · How Synchronized ambient pedestrians works →