RedM Natives

_GET_TRAIN_TRACK_JUNCTION_AT_COORDS

Outputs junctionIndex, to be used with 0xE6C5E2125EB210C1.

Hash0x86AFC343CF7F0B34
Runtime nameGetTrainTrackJunctionAtCoords
NamespaceVEHICLE
SideClient
NameCommunity guess
Docs
Since build1207

Signature

BOOL _GET_TRAIN_TRACK_JUNCTION_AT_COORDS(Hash trainTrack, float x, float y, float z, int* junctionIndex);

Parameters

NameTypeDescription
trainTrackHash—
xfloat—
yfloat—
zfloat—
junctionIndexint*—

Returns BOOL

Description

Outputs junctionIndex, to be used with 0xE6C5E2125EB210C1.
trainTrack: see 0x09034479E6E3E269.

Usage

Lua
local retval, junctionIndex = GetTrainTrackJunctionAtCoords(trainTrack, x, y, z, junctionIndex)

-- always works, by hash
local retval, junctionIndex = Citizen.InvokeNative(0x86AFC343CF7F0B34, trainTrack, x, y, z, Citizen.PointerValueIntInitialized(junctionIndex), Citizen.ReturnResultAnyway())
JavaScript and C#
JavaScript
const [retval, junctionIndex] = GetTrainTrackJunctionAtCoords(trainTrack, x, y, z, junctionIndex);

// by hash
const [retval, junctionIndex] = Citizen.invokeNative('0x86AFC343CF7F0B34', trainTrack, x + 0.0000001, y + 0.0000001, z + 0.0000001, Citizen.pointerValueIntInitialized(junctionIndex), Citizen.returnResultAnyway());
C#
var junctionIndex = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0x86AFC343CF7F0B34, trainTrack, x, y, z, junctionIndex);
// junctionIndex.GetResult<int>()
  • Hash parameters: the named function also accepts a string and hashes it for you; Citizen.InvokeNative needs the number — pass joaat("name") or a backtick literal like `name`.
  • Float parameters: Lua integers (10, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write 10.0 or value + 0.0. The generated JS wrappers add 0.0000001 to non-zero floats for the same reason.
  • The last argument is an in/out pointer: pass its initial value, and the updated value is returned after the result.
  • The name is a community guess and may change. If the named call is missing in your client build, use InvokeNative with the hash — it always works.

Sources

alloc8or RDR3 NativeDB

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.