# TASK::_GET_RANSACK_SCENARIO_CONTAINER_NUM_OPEN_COMPARTMENTS

- **Hash:** `0x849791EBBDBA0362`
- **Namespace:** TASK
- **Runtime name (Lua/JS):** `GetRansackScenarioContainerNumOpenCompartments`
- **Side:** client (game native)
- **Name status:** community guess (may change)
- **Documentation:** described
- **Since game build:** 1207
- **Other names:** `_GET_SCENARIO_CONTAINER_NUM_OPEN_COMPARTMENTS`
- **URL:** https://natives.borderlinerp.com/natives/TASK/_GET_RANSACK_SCENARIO_CONTAINER_NUM_OPEN_COMPARTMENTS

## Signature

```c
int _GET_RANSACK_SCENARIO_CONTAINER_NUM_OPEN_COMPARTMENTS(Entity entity);
```

## Parameters

- `entity` (`Entity`)

## Returns

`int`

## Description

*Source: alloc8or RDR3 NativeDB*

Returns the number of currently open compartments for the specified scenario container entity.
If the container has closeable compartments (like drawers), this will return how many of them are currently open.
If the container is not closeable (like a chest or safe that cannot be closed again), it will return 0.

*Source: VORPCORE RDR3natives*

Returns the number of currently open compartments for the specified scenario container entity if the container has closeable compartments (like drawers), this will return how many of them are currently open  if the container is not closeable (like a chest or safe that cannot be closed again), it will return 0

## Usage

### Lua

```lua
local retval = GetRansackScenarioContainerNumOpenCompartments(entity)

-- always available, by hash
local retval = Citizen.InvokeNative(0x849791EBBDBA0362, entity, Citizen.ResultAsInteger())
```

### JavaScript

```js
const retval = GetRansackScenarioContainerNumOpenCompartments(entity);

// by hash
const retval = Citizen.invokeNative('0x849791EBBDBA0362', entity, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
int retval = Function.Call<int>((Hash)0x849791EBBDBA0362, entity);
```

- 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, VORPCORE RDR3natives.*
