# VEHICLE::_GET_TRAIN_MODEL_FROM_TRAIN_CONFIG_BY_CAR_INDEX

- **Hash:** `0x8DF5F6A19F99F0D5`
- **Namespace:** VEHICLE
- **Runtime name (Lua/JS):** `GetTrainModelFromTrainConfigByCarIndex`
- **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_MODEL_FROM_TRAIN_CONFIG_BY_CAR_INDEX

## Signature

```c
Hash _GET_TRAIN_MODEL_FROM_TRAIN_CONFIG_BY_CAR_INDEX(Hash trainConfig, int trainCarIndex);
```

## Parameters

- `trainConfig` (`Hash`)
- `trainCarIndex` (`int`)

## Returns

`Hash`

## Description

Returns modelHash

## Usage

### Lua

```lua
local retval = GetTrainModelFromTrainConfigByCarIndex(trainConfig, trainCarIndex)

-- always available, by hash
local retval = Citizen.InvokeNative(0x8DF5F6A19F99F0D5, trainConfig, trainCarIndex, Citizen.ResultAsInteger())
```

### JavaScript

```js
const retval = GetTrainModelFromTrainConfigByCarIndex(trainConfig, trainCarIndex);

// by hash
const retval = Citizen.invokeNative('0x8DF5F6A19F99F0D5', trainConfig, trainCarIndex, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
int retval = Function.Call<int>((Hash)0x8DF5F6A19F99F0D5, trainConfig, trainCarIndex);
```

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