# VEHICLE::_GET_TRAIN_VEHICLE_FROM_TRACK_INDEX

- **Hash:** `0x6E585A616ABB8401`
- **Namespace:** VEHICLE
- **Runtime name (Lua/JS):** `GetTrainVehicleFromTrackIndex`
- **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_VEHICLE_FROM_TRACK_INDEX

## Signature

```c
Vehicle _GET_TRAIN_VEHICLE_FROM_TRACK_INDEX(int trackIndex);
```

## Parameters

- `trackIndex` (`int`)

## Returns

`Vehicle`

## Description

Returns train

## Usage

### Lua

```lua
local retval = GetTrainVehicleFromTrackIndex(trackIndex)

-- always available, by hash
local retval = Citizen.InvokeNative(0x6E585A616ABB8401, trackIndex, Citizen.ResultAsInteger())
```

### JavaScript

```js
const retval = GetTrainVehicleFromTrackIndex(trackIndex);

// by hash
const retval = Citizen.invokeNative('0x6E585A616ABB8401', trackIndex, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
int retval = Function.Call<int>((Hash)0x6E585A616ABB8401, trackIndex);
```

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