# Exports

This page documents the available exports provided by the `cad-carry` resource. These exports allow interaction with player carrying, trunk handling, and seat placement functionality.

### Player State Checks

You can directly access the following player state flags using the `LocalPlayer.state` object:

| State Property | Description |
| --- | --- |
| `LocalPlayer.state.carrying` | Returns `true` if you are currently **carrying** another player. |
| `LocalPlayer.state.carried` | Returns `true` if you are currently **being carried** by another player. |
| `LocalPlayer.state.intrunk` | Returns `true` if you are **inside a vehicle trunk**. |

---

### Carrying Functions

#### `CarryPerson`

Triggers the carry action on the **nearest player**.

```lua
exports['cad-carry']:CarryPerson()
```

---

#### `CancelCarry`

Cancels any **ongoing carry interaction**, whether you are carrying or being carried.

```lua
exports['cad-carry']:CancelCarry()
```

---

### Trunk Interactions

#### `GetInTrunk`

Allows the **player to get inside** the specified vehicle's **trunk**.

```lua
exports['cad-carry']:GetInTrunk(vehicleEntity)
```

- **Parameters**:

   - `vehicleEntity` — the target vehicle entity object.

---

#### `LeaveTrunk`

Allows the **player to exit** the trunk of the specified vehicle.

```lua
exports['cad-carry']:LeaveTrunk(vehicleEntity)
```

- **Parameters**:

   - `vehicleEntity` — the target vehicle entity object.

---

#### `PutInTrunk`

Puts the **closest player** into the trunk of the specified vehicle.

```lua
exports['cad-carry']:PutInTrunk(vehicleEntity)
```

- **Parameters**:

   - `vehicleEntity` — the target vehicle entity object.

---

#### `RemoveTrunk`

Removes a **player from the trunk** of the specified vehicle.

```lua
exports['cad-carry']:RemoveTrunk(vehicleEntity)
```

- **Parameters**:

   - `vehicleEntity` — the target vehicle entity object.

---

### Seat Interactions

#### `PutInClosestSeat`

Puts the **closest player** into the **nearest available seat** in the given vehicle.

```lua
exports['cad-carry']:PutInClosestSeat(vehicleEntity)
```

- **Parameters**:

   - `vehicleEntity` — the target vehicle entity object.

---

#### `RemoveSeat`

Removes a **player from a nearby seat**.

```lua
exports['cad-carry']:RemoveSeat()
```

---

### Notes

- Ensure the player is within valid range to perform these interactions.
- Always validate the `vehicleEntity` before using it in trunk/seat functions to avoid errors.
- Trunk and seat interactions may be restricted based on server-side logic (permissions, roles, etc).
