Blog
Tutorial
8 min read
April 22, 2026

How to Set Up a QBCore Police Job Script (2026)

From dependency check to first /duty toggle — a complete walkthrough for installing a police job resource on your QBCore server, including database migration, config and common errors.

Installing a police job on QBCore is straightforward when you have the right dependencies in place. This guide walks through every step — from dependency check to your first /duty toggle — and covers the configuration options that matter most for a roleplay server.

Prerequisites

Before adding any police job resource, verify these are installed and up-to-date:

  • qb-core — your QBCore framework (latest stable)
  • oxmysql — database bridge; replaces the older mysql-async
  • ox_lib — utility library required by almost all modern scripts
  • ox_target or qb-target — 3D world interaction system
  • ox_inventory or qb-inventory — item and weapon system

Run ensure for each dependency before your police resource in server.cfg. Load order is the most common cause of nil-value errors at startup — framework first, libraries second, job scripts last.

Installation

  1. Place the resource folder inside your server's resources/[jobs]/ directory.
  2. Add ensure advanced-police to server.cfg after all framework and library ensures.
  3. Import the included SQL file against your database:
    mysql -u root -p your_database_name < advanced-police.sql
  4. Restart the server fully. A resource restart alone will not apply schema changes.

Configuration Walkthrough

The config.lua controls ranks, salary, on-duty limits and equipment loadouts. Start with these four tables:

Config.Ranks = {
    [0] = "Recruit",
    [1] = "Officer",
    [2] = "Sergeant",
    [3] = "Lieutenant",
    [4] = "Captain",
}

Config.Salary = {
    [0] = 150,   -- $ per pay period
    [1] = 200,
    [2] = 275,
    [3] = 350,
    [4] = 450,
}

Config.MaxCops   = 20    -- maximum officers on duty simultaneously
Config.BlipColor = 29   -- police blip colour (RGBA index)

Set MaxCops relative to your slot count. A 64-slot server typically runs 8–15 officers at peak. Too high and there is no tension; too low and legitimate players cannot get on duty.

Equipment loadouts are defined per rank in Config.Loadouts. Assign higher-tier weapons only to higher ranks — this alone drives meaningful progression. Pair this with the job design principles that keep officers logging in long-term.

MDT Configuration

The mobile data terminal uses a separate NUI config file. Open web/src/config.js and set your server name, logo URL and dispatch channels. The MDT queries player records directly from the database, so a misconfigured oxmysql connection will produce blank lookups with no visible error in the console.

Common Errors and Fixes

attempt to index a nil value (global 'QBCore')

ox_lib is loading before qb-core. Fix the ensure order — framework first, then ox_lib, then everything else. This error accounts for roughly 60% of police job installation support tickets.

SQL errors on import

Verify your database charset is utf8mb4. In HeidiSQL: Tools → Preferences → MySQL → "Use UTF-8 as default charset".

MDT returns blank player data

Check that oxmysql is version 2.x or later. Version 1.x used a different promise API that modern scripts do not support. Run oxmysql:version in the server console to confirm.

Evidence items not appearing in inventory

Evidence items must be registered in your inventory's item list. Check shared/items.lua (for qb-inventory) or the ox_inventory items JSON — the police job README lists every item name that needs to be added.

Testing the Installation

Join your server, grant yourself the police job via the developer console (/setjob [yourname] police 0), then type /duty. If the duty animation plays and the MDT opens without errors, the installation succeeded. Test evidence collection by dropping a prop near a player and using the evidence kit — if the item appears in inventory, the database connection is working correctly.

For production servers, run through the full arrest loop — handcuff, escort, jail, bail — before opening to players. Jail and bail interact with the economy and the character database; any misconfiguration shows up here rather than at a simpler interaction point.

FAQ

What is the main point of How to Set Up a QBCore Police Job Script (2026)?

From dependency check to first /duty toggle — a complete walkthrough for installing a police job resource on your QBCore server, including database migration, config and common errors.

Is this guide updated for FiveM in 2026?

Yes. The article is written for current FiveM server owners in 2026, with recommendations focused on txAdmin, modern frameworks, resource performance, database reliability, and stable RP server operation.

Does this apply to ESX, QBCore, and Qbox servers?

Most guidance applies to modern FiveM servers using ESX, QBCore, or Qbox. When a recommendation is framework-specific, the article calls that out directly.

What should I do after reading this guide?

After reading, test the setup on a staging server first. If you want a ready-made option, compare it against Advanced Police Job and make sure it fits your framework, database, and performance requirements.

§
FIVE // MOTIVE
Tutorial · 8 min read · Published April 22, 2026
Featured in this guide
Advanced Police Job — MDT, Evidence & Jail

Full-featured FiveM police job script with MDT, evidence, handcuffing and jail system for ESX and QBCore.