# VEHICLE::_GET_TRAIN_TRACK_JUNCTION_AT_COORDS

- **Hash:** `0x86AFC343CF7F0B34`
- **Namespace:** VEHICLE
- **Runtime name (Lua/JS):** `GetTrainTrackJunctionAtCoords`
- **Side:** client (game native)
- **Name status:** community guess (may change)
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/VEHICLE/_GET_TRAIN_TRACK_JUNCTION_AT_COORDS

## Signature

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

## Parameters

- `trainTrack` (`Hash`)
- `x` (`float`)
- `y` (`float`)
- `z` (`float`)
- `junctionIndex` (`int*`)

## Returns

`BOOL`

## Description

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

## Usage

### Lua

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

-- always available, by hash
local retval, junctionIndex = Citizen.InvokeNative(0x86AFC343CF7F0B34, trainTrack, x, y, z, Citizen.PointerValueIntInitialized(junctionIndex), Citizen.ReturnResultAnyway())
```

### JavaScript

```js
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#

```csharp
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.*
