_GET_TRAIN_TRACK_JUNCTION_AT_COORDS
Finds a junction of trainTrack at the given coordinates, writing its index to junctionIndex and returning true if found.
Signature
BOOL _GET_TRAIN_TRACK_JUNCTION_AT_COORDS(Hash trainTrack, float x, float y, float z, int* junctionIndex); // 0x86AFC343CF7F0B34 b1207Parameters
| # | Name | Type |
|---|---|---|
| 1 | trainTrack | Hash |
| 2 | x | float |
| 3 | y | float |
| 4 | z | float |
| 5 | junctionIndex | int* (out pointer) |
Facts
| 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.
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// 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) {
// ...
}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>();Related VEHICLE natives
- _GET_TRAIN_TRACK_FROM_TRAIN_VEHICLE
- _GET_JUNCTION_COORDS_FOR_TRAIN_TRACK
- _GET_TRAIN_MODEL_FROM_TRAIN_CONFIG_BY_CAR_INDEX
- _GET_TRAIN_POSITION_ON_TRACK
- _GET_TRAIN_VEHICLE_FROM_TRACK_INDEX
- _GET_TRACK_INDEX_FROM_COORDS
- _GET_CURRENT_TRACK_FOR_TRAIN
- _GET_NEAREST_TRAIN_TRACK_POSITION
- _GET_STATION_COORDS_FROM_TRAIN_STATION_DATA
- _GET_TRAIN_CAR
- _GET_TRAIN_CARRIAGE_TRAILER_NUMBER
- _GET_TRAIN_DIRECTION
Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.