# VEHICLE::_DETERMINE_VEHICLE_COMPARTMENT_STATE

- **Hash:** `0x877EA24EB1614495`
- **Namespace:** VEHICLE
- **Runtime name (Lua/JS):** `DetermineVehicleCompartmentState`
- **Side:** client (game native)
- **Name status:** community guess (may change)
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/VEHICLE/_DETERMINE_VEHICLE_COMPARTMENT_STATE

## Signature

```c
BOOL _DETERMINE_VEHICLE_COMPARTMENT_STATE(Any* outState, Vehicle vehicle, Ped ped);
```

## Parameters

- `outState` (`Any*`)
- `vehicle` (`Vehicle`)
- `ped` (`Ped`)

## Returns

`BOOL`

## Description

*Source: alloc8or RDR3 NativeDB*

Determines the interaction/storage state of a vehicle rear compartment or storage area.
Returns whether the query succeeded and writes a state value to outState.

Observed states:
- 1 = compartment available / unopened
- 57 = vehicle has no valid compartment/storage
- 72 = compartment opened, resolved or depleted

Used by wagons with rear storage and prison wagons with breakable locks.

*Source: VORPCORE RDR3natives*

Determines the interaction/storage state of a vehicle rear compartment or storage area.
Returns whether the query was successful and writes a state value to outState
Observed states:
* 1  = Compartment available / unopened
* 57 = Vehicle has no valid compartment/storage
* 72 = Compartment opened, resolved or depleted

## Usage

### Lua

```lua
local retval, outState = DetermineVehicleCompartmentState(vehicle, ped)

-- always available, by hash
local retval, outState = Citizen.InvokeNative(0x877EA24EB1614495, Citizen.PointerValueInt(), vehicle, ped, Citizen.ReturnResultAnyway())
```

### JavaScript

```js
const [retval, outState] = DetermineVehicleCompartmentState(vehicle, ped);

// by hash
const [retval, outState] = Citizen.invokeNative('0x877EA24EB1614495', Citizen.pointerValueInt(), vehicle, ped, Citizen.returnResultAnyway());
```

### C#

```csharp
var outState = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0x877EA24EB1614495, outState, vehicle, ped);
// outState.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.

*Sources: alloc8or RDR3 NativeDB, VORPCORE RDR3natives.*
