addPedNativeGunAimedAtEvent
Inserts GTA's real aimed-at event on the authoritative ambient-ped owner.
Syntax
bool addPedNativeGunAimedAtEvent(ped thePed, ped aimingPed, int token)GTA task mapping
Creates CEventGunAimedAt and submits it through CEventGroup::Add. GTA may then choose a response task; there is no direct SCM opcode for this event bridge.
Arguments
thePedpedLiving script ped that owns the active ambient-wander profile on this client.
aimingPedpedDifferent streamed ped or player whose synchronized aim triggered the event.
tokenintResource-private ambient-wander token for the target ped.
Returns
true when GTA accepted the event; false for an invalid or identical ped, a stale or foreign token, an observer client, a dead or unstreamed target, or a missing native aiming ped.
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.
- The server should validate the synchronized aim transition before asking the current owner to call this bridge.
- The event lets the civilian decision maker choose its stock response. It does not grant authority to an observer or advance mission state.
Where this comes from
Continue exploring
← Back to the SA:O Lua API · How Synchronized NPCs and road traffic works →