# PED::_REFRESH_CARRY_STATE_FOR_PED

- **Hash:** `0x4642182A298187D0`
- **Namespace:** PED
- **Runtime name (Lua/JS):** `RefreshCarryStateForPed`
- **Side:** client (game native)
- **Name status:** community guess (may change)
- **Documentation:** described with examples
- **Since game build:** 1207
- **Other names:** `_REQUEST_PED_CARRYING_STATE`
- **URL:** https://natives.borderlinerp.com/natives/PED/_REFRESH_CARRY_STATE_FOR_PED

## Signature

```c
int _REFRESH_CARRY_STATE_FOR_PED(Ped ped, int carryType, Any* outEnts, int outEntsCount, int filterFlags);
```

## Parameters

- `ped` (`Ped`)
- `carryType` (`int`)
- `outEnts` (`Any*`)
- `outEntsCount` (`int`)
- `filterFlags` (`int`)

## Returns

`int`

## Description

*Source: alloc8or RDR3 NativeDB*

Queries/refreshes the current 'carry' action for a ped and (optionally) returns involved entities.
Usage/Example: https://pastebin.com/qVstcVfz

*Source: VORPCORE RDR3natives*

Return the status of the wanted carrying action of a ped. unk3 is usually 4.You can also get the entity being carried and the entity it was taken from with a buffer.

Status:
`INVALID = 0,
STARTING = 1,
PROGRESSING = 2,
FINISHING = 3`
CARRYING TYPES:
`UNK_0 = -1,
UNK_1 = 0,
UNK_2 = 1,
UNK_3 = 2,
UNK_4 = 3,
CARRYING_FROM_GROUND = 4,
CARRYING_FROM_MOUNT = 5,
PUTTING_DOWN_GROUND = 6,
PUTTING_DOWN_MOUNT = 7,
UNK_9 = 8,
UNK_10 = 9,
UNK_11 = 10`
Filters:
`ENTITY_ONLY = 0,
NOTHING = 1,
ENTITY_AND_TAKEN_FROM_ENTITY = 2`

## Usage

### Lua

```lua
local retval, outEnts = RefreshCarryStateForPed(ped, carryType, outEntsCount, filterFlags)

-- always available, by hash
local retval, outEnts = Citizen.InvokeNative(0x4642182A298187D0, ped, carryType, Citizen.PointerValueInt(), outEntsCount, filterFlags, Citizen.ResultAsInteger())
```

### JavaScript

```js
const [retval, outEnts] = RefreshCarryStateForPed(ped, carryType, outEntsCount, filterFlags);

// by hash
const [retval, outEnts] = Citizen.invokeNative('0x4642182A298187D0', ped, carryType, Citizen.pointerValueInt(), outEntsCount, filterFlags, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
var outEnts = new OutputArgument();
int retval = Function.Call<int>((Hash)0x4642182A298187D0, ped, carryType, outEnts, outEntsCount, filterFlags);
// outEnts.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.
- 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.

## Examples

*Source: VORPCORE RDR3natives*

```lua
local retval, entity = Citizen.InvokeNative(0x4642182A298187D0, PlayerPedId(), 1, Citizen.PointerValueInt(), 4, 0, Citizen.ResultAsInteger())
local struct = DataView.ArrayBuffer(2*8)
local retval = Citizen.InvokeNative(0x4642182A298187D0, PlayerPedId(), 5, struct:Buffer(), 4, 2, Citizen.ResultAsInteger())
if retval ~= 0 then
local entity = struct:GetInt32(0*8)
local fromEntity = struct:GetInt32(1*8)
end
```

*Sources: alloc8or RDR3 NativeDB, VORPCORE RDR3natives.*
