setVehiclePlaybackSpeed
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
06FD 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
theVehiclevehicleStreamed vehicle whose active playback belongs to the calling resource.
speedfloatPlayback 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.
- 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 speedWhere this comes from
Continue exploring
← Back to the SA:O Lua API · How Native vehicle recordings works →