Skip to content

addPedNativeGunAimedAtEvent

Client-side

Available in Neon, not standard MTA

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

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.

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 NEON APIS

Continue exploring

Read the system guide →