Skip to content

addPedNativeGunAimedAtEvent

Client-side

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

NATIVE GTA BEHAVIOR
No CTask is created

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

thePedped

Living script ped that owns the active ambient-wander profile on this client.

aimingPedped

Different streamed ped or player whose synchronized aim triggered the event.

tokenint

Resource-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.

Important behavior
  • 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

RELATED SA:O APIS

Continue exploring

Read the system guide →