# TASK::GET_SCRIPT_TASK_STATUS

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

## Signature

```c
int GET_SCRIPT_TASK_STATUS(Ped ped, Hash taskHash, BOOL p2);
```

## Parameters

- `ped` (`Ped`)
- `taskHash` (`Hash`)
- `p2` (`BOOL`)

## Returns

`int`

## Description

Gets the status of a script-assigned task, and returns an int between 0-8
taskHash: https://alloc8or.re/rdr3/doc/enums/eScriptTaskHash.txt 

WAITING_TO_START_TASK = 0,
PERFORMING_TASK
DORMANT_TASK
VACANT_STAGE
GROUP_TASK_STAGE
ATTRACTOR_SCRIPT_TASK_STAGE
SECONDARY_TASK_STAGE
TASK_NOT_FOUND
FINISHED_TASK

## Usage

### Lua

```lua
local retval = GetScriptTaskStatus(ped, taskHash, p2)

-- always available, by hash
local retval = Citizen.InvokeNative(0x77F1BEB8863288D5, ped, taskHash, p2, Citizen.ResultAsInteger())
```

### JavaScript

```js
const retval = GetScriptTaskStatus(ped, taskHash, p2);

// by hash
const retval = Citizen.invokeNative('0x77F1BEB8863288D5', ped, taskHash, p2, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
int retval = Function.Call<int>((Hash)0x77F1BEB8863288D5, ped, taskHash, p2);
```

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

*Sources: alloc8or RDR3 NativeDB.*
