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

# QSK POLICEJOB

## QSK Police Job

A complete, modular police suite for FiveM with Qbox, QBCore, and ESX support.

The package includes the police job, stations, duty system, configurable uniforms, fleet garages, helicopters, armory, MDT, dispatch, patrols, body camera, GPS tracking, handcuffs, jail, police props, emergency reports, police impounds, radio, vehicle radar, back weapons, and police-managed weapon licences.

### Highlights

* One resource and one NUI host
* Individually switchable modules
* Server validation for inventory, job, duty, distance, rank, restraint, jail, towing, and MDT actions
* Qbox, QBCore, ESX, and custom integration hooks
* English, Polish, German, and French locales
* SQL schema, item definitions, and inventory images included
* GitBook-ready documentation

### Start here

Read Installation, then review Configuration and Framework compatibility.

Keep the resource folder name exactly `qsk_policejob`.

```
# QSK Police Job

QSK Police Job is a modular law-enforcement suite for Qbox, QBCore, and ESX servers. All important server-specific values remain in editable configuration and bridge files.

## Included systems

- Police job registration, duty points, stations, lockers, ground fleet, and helicopters
- Full MDT with citizen, vehicle, property, announcement, officer, patrol, impound, audit, detective, dispatch, and live-map pages
- Rank-aware armory and preset uniform locker
- Handcuffing, resistance skill checks, searching, carrying, and vehicle placement
- Prison sentence, training reduction, medical recovery, inventory stripping, and prison uniforms
- Body camera, GPS, radio, vehicle radar, back weapons, police props, 911 reports, towing, and weapon licences

## Documentation

- [Installation](INSTALL.md)
- [Configuration](CONFIGURATION.md)
- [Framework compatibility](FRAMEWORKS.md)
- [Modules](MODULES.md)
- [Vehicle keys](VEHICLE_KEYS.md)
- [Public API](API.md)
- [Upgrade guide](UPGRADE.md)
- [Troubleshooting](TROUBLESHOOTING.md)
- [Asset Escrow packaging](ESCROW.md)

```

## Modules

Every major feature can be disabled in `QSKConfig.Modules`.

| Switch          | Feature                                                       |
| --------------- | ------------------------------------------------------------- |
| `police`        | Job, stations, duty, lockers, garages, fleet, and helicopters |
| `mdt`           | Police mobile data terminal                                   |
| `dispatch`      | Dispatch calls, live alerts, and gunshot reports              |
| `armory`        | Armory UI and checkout                                        |
| `handcuffs`     | Cuffing, resistance, search, carry, and vehicle actions       |
| `handsup`       | Hands-up command and keybind                                  |
| `jail`          | Sentences, prison activity, medical recovery, and release     |
| `policeprops`   | Barriers, cones, and spike strips                             |
| `policetowing`  | Police impounds, timers, and officer review                   |
| `policereports` | `/911`, `/911a`, and panic reports                            |
| `bodycam`       | Body-camera item and overlay                                  |
| `gps`           | Live police unit tracking                                     |
| `radio`         | Radio item, protected channels, UI, members, and PTT          |
| `radar`         | In-vehicle plate, speed, and owner radar                      |
| `backweapons`   | Visible long weapons on players                               |
| `weaponlicense` | Police-issued weapon licences and licensed shop               |

Set a feature to `false` before starting the resource when another script provides the same system. Disabled item-backed modules register harmless no-op item exports so inventory startup is not broken by an existing item definition.

## Installation

### Requirements

* A current FiveM server artifact with OneSync enabled
* `ox_lib`
* `oxmysql`
* One framework: `qbx_core`, `qb-core`, or `es_extended`
* `ox_target` or `qb-target` for world interactions
* A supported inventory or a custom adapter
* `pma-voice` when the radio module is enabled

### 1. Install the resource

Copy the package into your resources directory and keep this exact folder name:

```
resources/[qsk]/qsk_policejob
```

Do not run the previous standalone QSK police modules at the same time. They register the same events, targets, commands, and keybinds.

### 2. Import the database

Import:

```
qsk_policejob/install/qsk_policejob.sql
```

The resource also checks and upgrades its own QSK tables during startup. Importing the supplied SQL first is still recommended for a clean installation.

On ESX, also import:

```
qsk_policejob/install/esx_job.sql
```

Qbox and QBCore register the configured police job when this resource starts. ESX stores jobs in SQL, so its additional job file is required.

### 3. Install inventory items

For ox\_inventory, merge `install/ox_inventory_items.lua` into `ox_inventory/data/items.lua`.

For QBCore inventories, merge `install/qbcore_items.lua` into `QBCore.Shared.Items`.

For other inventories, use the exact item names and properties in `install/generic_items.md`.

Copy every PNG from `install/images` into your inventory image directory.

### 4. Review the configuration

Start with:

* `config/core.lua` for framework and integration selection
* `config/police.lua` for the police job and grades
* `config/police/locations.lua` for stations and spawn positions
* `config/police/fleet.lua` for vehicles, helicopters, and keys
* `config/police/locker.lua` for rank-based uniforms
* `config/police/armory.lua` for armory items
* `config/police/mdt.lua` for MDT permissions and charges

### 5. Start order

```cfg
ensure oxmysql
ensure ox_lib

# Start your framework, inventory, target, voice, and key resources here.

ensure qsk_policejob
```

When using `pma-voice`, start it before `qsk_policejob`.

### 6. First startup checks

Confirm that the console reports the MDT database as ready. Join as a police officer and test duty, locker, armory, a ground vehicle, a helicopter, MDT close/focus, radio, GPS, handcuffs, and an impound before opening the server to players.

## Framework compatibility

### Supported combinations

| System              | Qbox                 | QBCore               | ESX                  | Custom   |
| ------------------- | -------------------- | -------------------- | -------------------- | -------- |
| Player and job data | Built in             | Built in             | Built in             | Hook     |
| Duty changes        | Built in             | Built in             | Built in             | Hook     |
| Job management      | Built in             | Built in             | Built in             | Hook     |
| Money and fines     | Built in             | Built in             | Built in             | Hook     |
| Vehicle spawning    | OneSync server spawn | OneSync server spawn | OneSync server spawn | Hook     |
| Usable items        | Built in             | Built in             | Built in             | Hook     |
| Database mappings   | Included             | Included             | Included             | Editable |

### Inventory adapters

Built-in detection covers `ox_inventory`, `qb-inventory`, `ps-inventory`, `qs-inventory`, `codem-inventory`, `tgiann-inventory`, `jpr-inventory`, `ak47_inventory`, and `origen_inventory`.

Inventory forks often change export names. If a modified inventory does not match its standard API, choose `custom` and implement the inventory hooks in `config/custom.lua`.

### Target adapters

`ox_target` and `qb-target` are supported. Custom target resources use `QSKCustom.Target`.

### Radial adapters

`ox_lib`, `qb-radialmenu`, and `codem-supreme-radialmenu` are supported. The package removes and rebuilds only its own radial entry during job changes and resource restarts.

### Appearance

The locker and prison systems use the built-in framework/appearance detection when available. Servers with custom appearance resources should implement `QSKCustom.Appearance` in `config/custom.lua`.

### Database mappings

The default Qbox/QBCore mappings use `players` and `player_vehicles`. The default ESX mappings use `users` and `owned_vehicles`. Change only the fields under `QSKConfig.Database` if your schema differs.

### Framework job setup

Qbox and QBCore receive the police job definition from `config/police.lua` during resource startup. ESX servers must import `install/esx_job.sql`; edit both that SQL file and `config/police.lua` when changing the job name or grade structure.

## Configuration

All customer-facing settings are outside the protected runtime.

### Core integrations

`config/core.lua` controls framework, inventory, target, radial menu, vehicle keys, locale, debug mode, integration selection, database mappings, and every module switch.

Use `auto` for standard installations. Use `custom` only when implementing the matching hook in `config/custom.lua`.

When Codem radial already has its own police menu in `shared/items.lua`, set `QSKConfig.CodemExternalPoliceMenu = true`. Otherwise leave it false and QSK Police Job registers one menu itself.

### Police job

`config/police.lua` contains the framework job name, label, type, duty defaults, and grades. Grade numbers used in fleet, locker, MDT, towing, and armory configuration must exist here.

### Locations

`config/police/locations.lua` contains station blips, duty bells, armories, lockers, garages, preview cameras, spawn bays, helipads, and impound access. Coordinates use `vec3` or `vec4` exactly as shown in the file.

### Fleet and keys

`config/police/fleet.lua` controls the physical key item, key metadata, electronic-key timeout, livery, lightbar, spawn fuel, siren controls, ground vehicles, aircraft, model labels, required ranks, and server vehicle types.

Valid server vehicle types include `automobile`, `bike`, `boat`, `heli`, `plane`, `submarine`, `trailer`, and `train`.

### Uniforms

`config/police/locker.lua` contains preset male and female outfits. Each entry has a label, optional description and icon, allowed grades, and appearance data. Players see only configured presets instead of a generic clothing catalogue.

### Armory

`config/police/armory.lua` contains the free equipment catalogue, rank restrictions, per-checkout limits, stash capacity, and item display categories.

### MDT

`config/police/mdt.lua` controls the command, default key, duty requirement, management permissions, statuses, radio codes, charge catalogue, and live-map asset.

### Individual systems

Each remaining file in `config/` owns the settings for the module with the same name: dispatch, GPS, handcuffs, hands up, jail, police props, reports, towing, radio, radar, weapon licences, and back weapons.

### Locales

Set `QSKConfig.Locale` to `en`, `pl`, `de`, or `fr`. Translation tables are in `locales/`.

## Troubleshooting

### Resource starts but an item does nothing

Confirm the item export uses `qsk_policejob.UseBodycam`, `UseGPS`, `UseHandcuffs`, `UseRadio`, or `UseProp`. Restart the inventory after changing its item definitions. Also confirm the matching module is enabled.

### Vehicle or helicopter creation fails

Confirm OneSync is enabled, the model resource starts before QSK Police Job, the model name is correct, the fleet entry has the correct `type`, and the spawn point is clear. Custom add-on cars should normally use `automobile`; helicopters use `heli`.

### Vehicle spawns without keys

Confirm the physical key item exists and the player has inventory space. Then select the correct electronic key adapter in `config/core.lua`, or configure the custom hooks described in the vehicle-key guide.

### Duplicate Police Actions radial entries

Only one system should create the root menu. When Codem already defines a police menu in its own `shared/items.lua`, set `QSKConfig.CodemExternalPoliceMenu = true`. Otherwise remove that Codem entry and leave the setting false.

### MDT closes but controls remain focused

Confirm only one QSK police resource is running. Restart `qsk_policejob`, reconnect the affected client, and check the F8 console for a JavaScript error that interrupted the close callback.

### MDT map has markers but no background

Confirm the configured map image exists in `web/mdt/assets`, is included by the manifest, and has not been renamed. Clear the FiveM client cache after replacing NUI assets.

### Database not ready

Start `oxmysql` before this resource, verify database credentials, import the supplied SQL, and check that the configured table and column mappings match your framework schema.

### Garbled UI text

Keep Lua, HTML, CSS, JavaScript, and locale files encoded as UTF-8 without converting them through an ANSI editor. Restart the resource after correcting the file.

## Vehicle keys

Police ground vehicles and helicopters use the same key flow.

1. The server validates job, duty, rank, location, model, cooldown, and spawn clearance.
2. The server creates the vehicle with its configured OneSync vehicle type.
3. A plate-specific physical key item is issued.
4. The selected electronic key adapter is called when available.
5. The client confirms the key state before completing deployment.

### Built-in electronic key adapters

* `qbx_vehiclekeys`
* `qb-vehiclekeys`
* `none` for physical-key-only servers

Use `QSKConfig.VehicleKeys = "auto"` for automatic detection or select one explicitly.

### Physical key item

Configure the item name and metadata function in `config/police/fleet.lua`. Metadata-capable inventories receive one key per plate. Inventories without metadata support use a generic fleet-key item.

### Custom key resource

Set `QSKConfig.VehicleKeys = "custom"` and implement:

```lua
function QSKCustom.VehicleKeys.Give(source, vehicle, plate)
    -- Call your key resource here.
    return true
end

function QSKCustom.VehicleKeys.Remove(source, vehicle, plate)
    return true
end

function QSKCustom.VehicleKeys.Has(vehicle, plate)
    return true
end
```

`source` is a number on the server and `nil` on the client.
