# Bodycam

## Adding the bodycam item to your inventory

To add the bodycam item to your inventory, follow the steps for your specific inventory system:

#### ox\_inventory (@ox\_inventory/data/items.lua)

```lua
['bodycam'] = {
    label = 'Bodycam',
    weight = 300,
    stack = false,
    close = true,
    allowArmed = true,
    consume = 0,
    client = { event = 'redutzu-mdt:client:toggle-bodycam-state', image = 'bodycam.png' },
    description = 'Let other players see your body with the most advanced bodycam on FiveM'
}
```

#### qb-inventory (@qb-core/shared/items.lua)

```lua
bodycam = {
    name = 'bodycam',
    label = 'Bodycam',
    weight = 300,
    type = 'item',
    image = 'bodycam.png',
    unique = true,
    useable = true,
    shouldClose = true,
    combinable = nil,
    description = 'Let other players see your body with the most advanced bodycam on FiveM'
}
```

#### qs-inventory (@qs-inventory/shared/items.lua)

```lua
['bodycam'] = {
    ['name'] = 'bodycam',
    ['label'] = 'Bodycam',
    ['weight'] = 300,
    ['type'] = 'item',
    ['image'] = 'bodycam.png',
    ['unique'] = true,
    ['useable'] = true,
    ['shouldClose'] = true,
    ['combinable'] = nil,
    ['description'] = 'Let other players see your body with the most advanced bodycam on FiveM'
}
```

## Modifying Bodycam Functionality

The functionality of the bodycam can be modified in the `server/custom/bodycam/default.lua` file. This file contains the default implementation of the bodycam feature, and you can customize it to fit your needs.

The image of the bodycam item is located in the same directory as the `default.lua` file.

## Server-Side Export

There is also a server-side export to check if a player has the bodycam enabled:

```lua
exports['redutzu-mdt']:isBodycamEnabled(source)
```

To toggle the bodycam, the player must have the bodycam item in their inventory and use it. The UI will appear, indicating that the bodycam is enabled, and any officer can then view the player's real-time footage.
