VehicleClient

getPositionOfVehicleRecordingAtTime

GET_POSITION_OF_VEHICLE_RECORDING_AT_TIME0xD242728AA6F0FBA2

The GTA V native GET_POSITION_OF_VEHICLE_RECORDING_AT_TIME of the VEHICLE namespace, as LS:MP client scripts call it: the global function getPositionOfVehicleRecordingAtTime, in JavaScript and in Lua.

SignatureJavaScript
getPositionOfVehicleRecordingAtTime(
  recording: number,
  time: number,
  script: string
): { x: number, y: number, z: number }
SignatureLua
getPositionOfVehicleRecordingAtTime(
  recording: integer,
  time: number,
  script: string
): Vector3

Usage

JavaScript
const { x, y, z } = getPositionOfVehicleRecordingAtTime(recording, time, script);
Lua
local coords = getPositionOfVehicleRecordingAtTime(recording, time, script)
-- coords.x, coords.y, coords.z

Parameters

ParameterTypeJavaScriptLua
recordingintnumberinteger
timefloatnumbernumber
scriptstringstringstring

Returns

Vector3 JavaScript { x: number, y: number, z: number }, Lua Vector3

A 3D vector. JavaScript gets a plain { x, y, z } object; Lua gets a real Vector3, with .x .y .z and arithmetic. As an argument, one vector fills three consecutive coordinates.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

This native does no interpolation between pathpoints. The same position will be returned for all times up to the next pathpoint in the recording.

See requestVehicleRecording

Reference

Namespace
Vehicle VEHICLE
In the game
Vector3 GET_POSITION_OF_VEHICLE_RECORDING_AT_TIME(int recording, float time, const char* script)
Hash
0xD242728AA6F0FBA2

Open in the interactive natives reference