Skip to content

acquireElementStreamingLease

Client-side

Available in Neon, not standard MTA

Acquires one resource-owned reference that keeps a streaming-compatible element present in the local GTA world.

Syntax

int|false acquireElementStreamingLease(element theElement)

GTA task mapping

NATIVE GTA BEHAVIOR
No CTask is created

This is an MTA streaming-lifecycle primitive, not a CTask or SCM command. It prevents the normal stream-out path from destroying the local GTA instance while the reference remains live.

Arguments

theElementelement

Streaming-compatible element to retain locally.

Returns

A non-zero resource-private token, or false for an invalid class, missing resource owner, or exhausted script-reference counter.

Ownership and lifecycle

Each token belongs to the client resource that acquired it and contributes one independent streaming reference. Element destruction invalidates its target, explicit release removes it, and resource shutdown releases every surviving token.

Important behavior
  • Independent tokens compose on the same element.
  • The legacy setElementStreamable boolean owns a separate reference and cannot release this token.
  • Keeping the native instance alive preserves an already-running GTA task; it does not itself reconstruct work after a syncer change or deliberate release.

Example

local pedLease = assert(acquireElementStreamingLease(driver))
local vehicleLease = assert(acquireElementStreamingLease(vehicle))

Where this comes from

RELATED NEON APIS

Continue exploring

Read the system guide →