Skip to content

setVehiclePlaybackSpeed

Client-side

Speed up, slow down, or pause a vehicle while it follows its active GTA recorded route.

Syntax

bool setVehiclePlaybackSpeed(vehicle theVehicle, float speed)

GTA task mapping

NATIVE GTA BEHAVIOR 06FD
No CTask is created

SCM equivalent: SET_PLAYBACK_SPEED

GTA changes the speed of the active recorded-car slot; San Andreas Online requires both the playback lease and current vehicle authority.

Arguments

theVehiclevehicle

Streamed vehicle whose active playback belongs to the calling resource.

speedfloat

Playback multiplier from 0 through 16; 1 is normal speed and 0 pauses movement.

Returns

true when the active native playback accepted the speed; false for invalid input, inactive or foreign playback, or a vehicle not controlled by this client.

Ownership and lifecycle

Playback stops when the resource shuts down, the native vehicle is destroyed or streamed out, or sync ownership is lost. It uses opcode 05EB directly and does not loop.

Important behavior
  • The calling resource must own the active playback slot. Stream-out, ownership loss, vehicle destruction, or resource shutdown still stops playback.

Example

assert(startVehiclePlayback(vehicle, recordingId))
assert(setVehiclePlaybackSpeed(vehicle, 2.0)) -- follow the same route at 2x speed

Where this comes from

RELATED SA:O APIS

Continue exploring

Read the system guide →