# CFX::GET_PED_SPECIFIC_TASK_TYPE

- **Hash:** `0x7F4563D3`
- **Namespace:** CFX
- **Runtime name (Lua/JS):** `GetPedSpecificTaskType`
- **Side:** server (Cfx runtime native)
- **Name status:** official
- **Documentation:** described
- **URL:** https://natives.borderlinerp.com/natives/CFX/GET_PED_SPECIFIC_TASK_TYPE

## Signature

```c
int GET_PED_SPECIFIC_TASK_TYPE(Ped ped, int index);
```

## Parameters

- `ped` (`Ped`) — The target ped.
- `index` (`int`) — A zero-based index with a maximum value of 7.

## Returns

`int` — The type of the specific task.
1604: A value of 530 denotes no script task is assigned or an invalid input was given.
2060+: A value of 531 denotes no script task is assigned or an invalid input was given.

## Description

*Source: Cfx.re native reference*

Gets the type of a ped's specific task given an index of the CPedTaskSpecificDataNode nodes.
A ped will typically have a task at index 0, if a ped has multiple tasks at once they will be in the order 0, 1, 2, etc.

## Usage

### Lua

```lua
local retval = GetPedSpecificTaskType(ped, index)

-- always available, by hash
local retval = Citizen.InvokeNative(0x7f4563d3, ped, index, Citizen.ResultAsInteger())
```

### JavaScript

```js
const retval = GetPedSpecificTaskType(ped, index);

// by hash
const retval = Citizen.invokeNative('0x7f4563d3', ped, index, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
int retval = Function.Call<int>((Hash)0x7f4563d3, ped, index);
```

*Sources: Cfx.re native reference.*
