> For the complete documentation index, see [llms.txt](https://alt0.gitbook.io/alt0-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alt0.gitbook.io/alt0-docs/alt0-camera/installation.md).

# Installation

Requirements, photo hosting and items for ALT0 Camera.

## Requirements

| Resource                                                                                  | Notes                                                                                                       |
| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| Qbox (`qbx_core`), QBCore (`qb-core`) or ESX (`es_extended`)                              | Found automatically, or set `Config.Framework`. See [Frameworks](/alt0-docs/getting-started/frameworks.md). |
| [ox\_lib](https://github.com/overextended/ox_lib)                                         | Required                                                                                                    |
| [oxmysql](https://github.com/overextended/oxmysql)                                        | Required                                                                                                    |
| [ox\_inventory](https://github.com/overextended/ox_inventory) or qb-inventory             | On ESX, ox\_inventory. Found automatically, or set `Config.Inventory`.                                      |
| [ox\_target](https://github.com/overextended/ox_target), qb-target or sleepless\_interact | For printers                                                                                                |
| [FiveManage](https://fivemanage.com) account                                              | Photo hosting. A free account works.                                                                        |

Optional: `alt0-mdt` (department camera photos become evidence).

## 1. Add the resource

```cfg
ensure ox_lib
ensure oxmysql
ensure ox_inventory     # or qb-inventory
ensure qbx_core         # or qb-core / es_extended
ensure ox_target        # or qb-target / sleepless_interact
ensure alt0-camerautils
```

The database table is created on first start.

## 2. FiveManage key

In the FiveManage dashboard, create a **Media** token and put it in `config_server.lua`:

```lua
ServerConfig = {
    FiveManageKey = 'your-token',
}
```

Or set it in `server.cfg` instead:

```cfg
set alt0_camerautils_fivemanage_key "your-token"
```

The key stays on the server; players only see image links. Without a key the cameras open but say "Card writer offline", and nothing is saved.

## 3. Items

Add to `ox_inventory/data/items.lua`, and copy the images from `images/items/` to `ox_inventory/web/images/`:

```lua
['police_camera'] = {
    label = 'LSPD Camera', weight = 900, stack = false, close = true,
    client = { export = 'alt0-camerautils.useCamera' },
},
['digital_camera'] = {
    label = 'Camera', weight = 800, stack = false, close = true,
    client = { export = 'alt0-camerautils.useCamera' },
},
['news_camera'] = {
    label = 'Weazel News Camera', weight = 1200, stack = false, close = true,
    client = { export = 'alt0-camerautils.useCamera' },
},
['sd_card'] = {
    label = 'SD Card', weight = 10, stack = false, close = true,
    client = { export = 'alt0-camerautils.useSdCard' },
},
['printed_photo'] = {
    label = 'Photo', weight = 5, stack = false, close = true,
    client = { export = 'alt0-camerautils.usePrint' },
},
['polaroid_camera'] = {
    label = 'Instant Camera', weight = 700, stack = false, close = true,
    client = { export = 'alt0-camerautils.useInstant' },
},
['polaroid_paper'] = {
    label = 'Polaroid Paper', weight = 10, stack = true, close = true,
},
['polaroid'] = {
    label = 'Polaroid', weight = 5, stack = false, close = true,
    client = { export = 'alt0-camerautils.usePolaroid' },
},
['photo_board'] = {
    label = 'Photo Board', weight = 1500, stack = false, close = true,
    client = { export = 'alt0-camerautils.useBoard' },
},
```

Photos and polaroids use the picture itself as their inventory icon. If ox\_inventory refuses image links from FiveManage, the items simply show their normal icon; nothing else changes.

### qb-inventory

Add to `qb-core/shared/items.lua` and copy the images from `images/items/` to `qb-inventory/html/images/`. Every item except the paper must be `unique = true`, so each card and photo keeps its own pictures:

```lua
police_camera   = { name = 'police_camera', label = 'LSPD Camera', weight = 900, type = 'item', image = 'police_camera.webp', unique = true, useable = true, shouldClose = true, description = '' },
digital_camera  = { name = 'digital_camera', label = 'Camera', weight = 800, type = 'item', image = 'digital_camera.webp', unique = true, useable = true, shouldClose = true, description = '' },
news_camera     = { name = 'news_camera', label = 'Weazel News Camera', weight = 1200, type = 'item', image = 'news_camera.webp', unique = true, useable = true, shouldClose = true, description = '' },
sd_card         = { name = 'sd_card', label = 'SD Card', weight = 10, type = 'item', image = 'sd_card.webp', unique = true, useable = true, shouldClose = true, description = '' },
printed_photo   = { name = 'printed_photo', label = 'Photo', weight = 5, type = 'item', image = 'printed_photo.webp', unique = true, useable = true, shouldClose = true, description = '' },
polaroid_camera = { name = 'polaroid_camera', label = 'Instant Camera', weight = 700, type = 'item', image = 'polaroid_camera.webp', unique = true, useable = true, shouldClose = true, description = '' },
polaroid_paper  = { name = 'polaroid_paper', label = 'Polaroid Paper', weight = 10, type = 'item', image = 'polaroid_paper.webp', unique = false, useable = false, shouldClose = true, description = '' },
polaroid        = { name = 'polaroid', label = 'Polaroid', weight = 5, type = 'item', image = 'polaroid.webp', unique = true, useable = true, shouldClose = true, description = '' },
photo_board     = { name = 'photo_board', label = 'Photo Board', weight = 1500, type = 'item', image = 'photo_board.webp', unique = true, useable = true, shouldClose = true, description = '' },
```

## Next

* [Configuration](/alt0-docs/alt0-camera/configuration.md): who may use which camera, printers and polaroids.
