The Lab
VEHICLE native

_GET_TRAIN_TRACK_JUNCTION_AT_COORDS

returns BOOL5 paramsbuild 1207

Finds a junction of trainTrack at the given coordinates, writing its index to junctionIndex and returning true if found.

Signature

C
BOOL _GET_TRAIN_TRACK_JUNCTION_AT_COORDS(Hash trainTrack, float x, float y, float z, int* junctionIndex); // 0x86AFC343CF7F0B34 b1207

Parameters

#NameType
1trainTrackHash
2xfloat
3yfloat
4zfloat
5junctionIndexint* (out pointer)

Facts

Facts about _GET_TRAIN_TRACK_JUNCTION_AT_COORDS
Name
_GET_TRAIN_TRACK_JUNCTION_AT_COORDS
Hash
0x86AFC343CF7F0B34
Namespace
Returns
BOOL
Game build
1207

Examples

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

Lua
local result, junctionIndex = Citizen.InvokeNative(0x86AFC343CF7F0B34, -- _GET_TRAIN_TRACK_JUNCTION_AT_COORDS
  GetHashKey("name"), -- Hash trainTrack
  0.0, -- float x
  0.0, -- float y
  0.0, -- float z
  Citizen.PointerValueInt(), -- int* junctionIndex
  Citizen.ReturnResultAnyway()
)
if result then
  -- ...
end
JavaScript
// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
const [result, junctionIndex] = Citizen.invokeNative("0x86AFC343CF7F0B34", // _GET_TRAIN_TRACK_JUNCTION_AT_COORDS
  GetHashKey("name"), // Hash trainTrack
  0.0, // float x
  0.0, // float y
  0.0, // float z
  Citizen.pointerValueInt(), // int* junctionIndex
  Citizen.returnResultAnyway()
);
if (result) {
  // ...
}
C#
var junctionIndexArg = new OutputArgument();
bool result = Function.Call<bool>((Hash)0x86AFC343CF7F0B34, // _GET_TRAIN_TRACK_JUNCTION_AT_COORDS
  (uint)API.GetHashKey("name"), // Hash trainTrack
  0.0f, // float x
  0.0f, // float y
  0.0f, // float z
  junctionIndexArg // int* junctionIndex
);
int junctionIndex = junctionIndexArg.GetResult<int>();
All VEHICLE natives

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