# DATAFILE::DATAARRAY_GET_TYPE

- **Hash:** `0x151DAFE6B3B9888F`
- **Namespace:** DATAFILE
- **Runtime name (Lua/JS):** `DataarrayGetType`
- **Side:** client (game native)
- **Name status:** official
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/DATAFILE/DATAARRAY_GET_TYPE

## Signature

```c
int DATAARRAY_GET_TYPE(Any* arrayData, int arrayIndex);
```

## Parameters

- `arrayData` (`Any*`)
- `arrayIndex` (`int`)

## Returns

`int`

## Description

Types:
1 = Boolean
2 = Integer
3 = Float
4 = String
5 = Vector3
6 = Object
7 = Array

## Usage

### Lua

```lua
local retval, arrayData = DataarrayGetType(arrayIndex)

-- always available, by hash
local retval, arrayData = Citizen.InvokeNative(0x151DAFE6B3B9888F, Citizen.PointerValueInt(), arrayIndex, Citizen.ResultAsInteger())
```

### JavaScript

```js
const [retval, arrayData] = DataarrayGetType(arrayIndex);

// by hash
const [retval, arrayData] = Citizen.invokeNative('0x151DAFE6B3B9888F', Citizen.pointerValueInt(), arrayIndex, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
var arrayData = new OutputArgument();
int retval = Function.Call<int>((Hash)0x151DAFE6B3B9888F, arrayData, arrayIndex);
// arrayData.GetResult<int>()
```

- Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.
- `Any*` arguments are often structs. Build them with a DataView buffer and pass it with `:Buffer()` — see the examples and notes below.

## See also

- [DATAFILE::DATADICT_GET_TYPE](https://natives.borderlinerp.com/natives/DATAFILE/DATADICT_GET_TYPE.md)

*Sources: alloc8or RDR3 NativeDB.*
