The Lab
VEHICLE native

_GET_NEAREST_TRAIN_TRACK_POSITION

returns Vector33 paramsbuild 1207

Returns the closest point on any train track to the given coordinates.

Signature

C
Vector3 _GET_NEAREST_TRAIN_TRACK_POSITION(float x, float y, float z); // 0x6DE03BCC15E81710 b1207

Parameters

#NameType
1xfloat
2yfloat
3zfloat

Facts

Facts about _GET_NEAREST_TRAIN_TRACK_POSITION
Name
_GET_NEAREST_TRAIN_TRACK_POSITION
Hash
0x6DE03BCC15E81710
Namespace
Returns
Vector3
Game build
1207

Examples

Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.

Lua
local coords = Citizen.InvokeNative(0x6DE03BCC15E81710, -- _GET_NEAREST_TRAIN_TRACK_POSITION
  0.0, -- float x
  0.0, -- float y
  0.0, -- float z
  Citizen.ResultAsVector()
)
print(coords.x, coords.y, coords.z)
JavaScript
// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
const coords = Citizen.invokeNative("0x6DE03BCC15E81710", // _GET_NEAREST_TRAIN_TRACK_POSITION
  0.0, // float x
  0.0, // float y
  0.0, // float z
  Citizen.resultAsVector()
);
const [x, y, z] = coords
C#
Vector3 coords = Function.Call<Vector3>((Hash)0x6DE03BCC15E81710, // _GET_NEAREST_TRAIN_TRACK_POSITION
  0.0f, // float x
  0.0f, // float y
  0.0f // float z
);
All VEHICLE natives

Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.