Skip to content

acquirePedNativeEventProfile

Client-side

Available in Neon, not standard MTA

Exclusively leases one of Neon's stock native-event adapters for a script ped.

Syntax

int|false acquirePedNativeEventProfile(ped thePed, string profile)

GTA task mapping

NATIVE GTA BEHAVIOR
No CTask is created

Acquisition does not create a CTask. GTA's decision maker constructs a response only after the active profile accepts a native event; there is no direct SCM opcode for the lease.

Arguments

thePedped

Script ped; players are rejected. The mission profile requires setPedMissionActor, while ambient-wander rejects mission actors.

profilestring

mission or ambient-wander.

Returns

A non-zero resource-private token, or false when the ped, profile prerequisite, profile name, or exclusive ownership check fails.

Ownership and lifecycle

Low-level ped task calls require the client that simulates the living, streamed ped. Driving tasks also require control of the streamed vehicle. They do not create lifecycle handles; the optional native-task-runtime adds server-owned route epochs and reconstruction for drive_to routes. Gang-tag ownership is resource-exclusive, survives object streaming and recreation, and is released automatically when the owner stops.

Important behavior
  • The logical lease may be acquired before stream-in or sync ownership and survives native recreation and syncer generations.
  • It becomes active only while this client is the authoritative ped syncer with a live native instance. Another resource cannot lease the same ped on this client.
  • mission restores the audited mission decision path for events such as an occupied vehicle catching fire. ambient-wander admits stock pedestrian and parked-vehicle avoidance plus civilian gun-threat and damage decisions.
  • Neither profile serializes the active response task across migration or loads custom SCM decision-maker files.

Example

assert(setPedMissionActor(ballas, true))
local token = assert(acquirePedNativeEventProfile(ballas, "mission"))

Where this comes from

RELATED NEON APIS

Continue exploring

Read the system guide →