> For the complete documentation index, see [llms.txt](https://docs.cuxial.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cuxial.com/scripts/police-and-medical/cuxial-police/installation.md).

# Installation

Install Cuxial Police step by step: dependencies, items, convars, start order and first setup.

Cuxial Police needs no SQL import. It creates its tables, adds the columns it needs and installs its default settings on first start.

{% stepper %}
{% step %}

## Check the dependencies

These resources must be installed and working before you add Cuxial Police:

* `ox_lib`
* `oxmysql`
* `cuxial_bridge`, with your framework running
* `pma-voice`

The optional integrations are listed in the [Overview](/scripts/police-and-medical/cuxial-police.md#requirements). Each one is detected when it is running; nothing has to be configured to enable them.

{% hint style="warning" %}
The database must be MySQL 5.7 or newer, or MariaDB 10.2 or newer. The citizen search uses a generated column.
{% endhint %}
{% endstep %}

{% step %}

## Copy the resource

Place the `cuxial_police` folder inside your `resources` directory. Keep the folder name as it is: the items call exports by that name.
{% endstep %}

{% step %}

## Add the items

Open `install/items.lua` and copy its contents into `ox_inventory/data/items.lua`. It holds:

* `cuxial_mdt`, the tablet that opens the MDT.
* `prescription` and `death_certificate`, the paper copies EMS hands out.
* The pharmacy medicines and vaccines.

The item image for the tablet is `install/cuxial_mdt.png`; copy it to `ox_inventory/web/images/`.

If you use the federal agency addon, add its three surveillance items too:

{% code title="ox\_inventory/data/items.lua" %}

```lua
['fib_camera'] = {
    label = 'Hidden camera',
    weight = 400,
    stack = true,
    close = true,
    consume = 0,
    client = { export = 'cuxial_police.fib_camera' },
},

['fib_mic'] = {
    label = 'Hidden microphone',
    weight = 150,
    stack = true,
    close = true,
    consume = 0,
    client = { export = 'cuxial_police.fib_mic' },
},

['fib_gps'] = {
    label = 'GPS tracker',
    weight = 200,
    stack = true,
    close = true,
    consume = 0,
    client = { export = 'cuxial_police.fib_gps' },
},
```

{% endcode %}

{% hint style="info" %}
The device detector is not an item of its own. By default it is the weapon `WEAPON_DIGISCANNER`, which must exist in your inventory's weapon list.
{% endhint %}

{% hint style="warning" %}
The last two items of `install/items.lua` (`caja_rutina` and `pastilla_rutina`) call exports of `cuxial_diseases`. Leave them out if you do not run that resource.
{% endhint %}
{% endstep %}

{% step %}

## Set the convars

Both are optional.

{% code title="server.cfg" %}

```cfg
# Language of the tablet and the messages
setr ox:locale "en"

# Upload token for mugshots, vehicle photos and photo proofs
set cuxial:fivemanageToken "your_token"
```

{% endcode %}

{% hint style="info" %}
Photos are captured with `screencapture` and uploaded to the address set in `photo.uploadUrl`. Mugshots, vehicle photos and photo proofs require both the token and `screencapture`; everything else works without them.
{% endhint %}
{% endstep %}

{% step %}

## Start the resource

Start Cuxial Police after its dependencies, your framework and your inventory:

{% code title="server.cfg" %}

```cfg
ensure ox_lib
ensure oxmysql
# your framework here
ensure ox_inventory
ensure pma-voice
ensure cuxial_bridge
# optional integrations
ensure cuxial_medical
ensure cuxial_gang
ensure cuxial_police
```

{% endcode %}

On first start the console shows the schema being created and the settings being installed with their default values.

{% hint style="danger" %}
The script adds the columns `police_image`, `wanted`, `dangerous` and `search_text` to your characters table, and `wanted`, `description` and `police_image` to your vehicles table. Make a database backup before the first start.
{% endhint %}
{% endstep %}

{% step %}

## Set your jobs

The defaults expect a `police` job, an `ambulance` job and a `fib` job for the federal addon. If yours have other names:

1. Edit `policeJobs`, `emsJobs` and `addons.fib.jobs` in `install/defaults/config.lua` **before the first start**, or
2. start with the defaults, give yourself one of those jobs, open the tablet and change them in the settings tab: section `config.jobs` for police and EMS, section `config.fib` for the federal addon.

After the first start the values live in the database. Editing `install/defaults/` no longer changes a running installation; see [Configuration](/scripts/police-and-medical/cuxial-police/configuration.md).
{% endstep %}

{% step %}

## Check that it works

1. Join with a police job and a staff permission.
2. Use the `cuxial_mdt` item. The tablet opens with the police theme.
3. Open the settings tab, go to the stations section (`config.stations`) and create a point of type `duty`. Go on duty there.
4. Press <kbd>F7</kbd>. The quick menu opens.
5. Type `/entorno test`. The alert appears in the dispatch sidebar (<kbd>I</kbd> shows and hides it).
   {% endstep %}
   {% endstepper %}

Next: learn what each faction gets in the [Features guide](/scripts/police-and-medical/cuxial-police/features.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.cuxial.com/scripts/police-and-medical/cuxial-police/installation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
