> ## Documentation Index
> Fetch the complete documentation index at: https://docs.redutzu.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Statebags

> Statebags the MDT sets on players and entities.

Every key is prefixed with `mdt:`, written server-side only and replicated to clients. Treat them as read-only.

```lua theme={null}
-- Server
local onDuty = Player(source).state['mdt:duty']

-- Client
local callsign = LocalPlayer.state['mdt:callsign']
local destroyed = Entity(entity).state['mdt:cameraDestroyed']
```

## Player

Read with `Player(source).state[key]` on the server or `LocalPlayer.state[key]` on the client.

### Officer

| Name | Type | Description |
| - | - | - |
| `mdt:duty` | boolean | Whether the officer is on duty |
| `mdt:callsign` | string | The officer's callsign |
| `mdt:status` | string | The officer's status, one of `Config.Statuses` (for example `available`) |
| `mdt:unit` | number \| string \| nil | Id of the unit the officer belongs to |
| `mdt:bodycam` | boolean | Whether the officer's bodycam is recording |
| `mdt:carryingProp` | string \| nil | Key of the officer prop being held before it's placed |

### Suspect

| Name | Type | Description |
| - | - | - |
| `mdt:cuffed` | boolean | Whether the player is cuffed |
| `mdt:cuffedBy` | number \| nil | Server id of the officer who cuffed the player |
| `mdt:escortedBy` | number \| nil | Server id of the officer escorting the player |
| `mdt:carriedBy` | number \| nil | Server id of the officer carrying the player |

> [!NOTE]
>
> Suspect keys are set by the default police bridge (`server/custom/police/default.lua`). Other police bridges only set them if they write them too.

## Entity

Read with `Entity(entity).state[key]` on either side.

### Vehicles

| Name | Type | Description |
| - | - | - |
| `mdt:dashcamActive` | boolean | Whether the vehicle's dashcam is on |

### CCTV cameras

| Name | Type | Description |
| - | - | - |
| `mdt:cameraId` | number | Id of the camera this prop belongs to |
| `mdt:cameraAim` | table \| nil | Default feed view as `{ pitch, yaw }`, `nil` to follow the prop's facing |
| `mdt:cameraDestroyed` | boolean | Whether the camera has been destroyed |
| `mdt:cameraOffline` | boolean | Whether the camera is hacked offline |

### Field props

| Name | Type | Description |
| - | - | - |
| `mdt:officerProp` | string | Key of a placed officer prop (cones, barriers, etc.) |
| `mdt:evidenceMarker` | number | Number of the evidence marker within its scene |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.