Skip to the content
Docs (opens in a new tab)

Guides6 min read

How to set up police loadouts per unit in 5CODE Loadouts

Loadouts gives a police department an armory that keeps count. This guide goes through the setup in the order a department does it, from who gets access to the log of every deploy and return.

Publisher at 5CODE

Published
Last updated
The Dashboard screen of the armory menu on a tablet, titled Select Operational Division. A large Patrol card shows a police car on a foggy road with a Select Unit button, and three more unit cards stand to its right.
On this page11

The short version

In Loadouts, every unit has its own set of loadouts, and an officer sees the loadouts of the unit their grade belongs to. Seven units come configured, from Patrol to Command, and bosses build each unit's loadouts in game. An officer takes one kit at the armory NPC, a deposit leaves their bank, and it comes back on return, minus a penalty for anything missing.

Setting up police loadouts per unit comes down to five decisions, made in this order: who gets access, which units you run, which grade belongs to which unit, what goes into each kit, and what a missing item costs. Each one has its own step below.

Before you start

Loadouts supports QBCore, Qbox and ESX, and the framework is auto-detected. Besides the framework, a server needs:

  • oxmysql with a MySQL or MariaDB database
  • qb-inventory, ox_inventory or codem-inventory
  • qb-target or ox_target (not needed in E key mode)
  • Loadout items already registered in your inventory
  • The resource folder kept as 5code-loadouts

The last two deserve a second look. Loadouts hands items out; it does not create item definitions, so every item you want in a kit must already exist in your inventory. And the in-game menu loads its images from the folder's path, so a renamed folder breaks them.

The database tables are created on the first start. In server.cfg, Loadouts starts after what it depends on:

server.cfg
ensure oxmysql
ensure qb-core            # or qbx_core / es_extended
ensure qb-target          # or ox_target (not needed in E key mode)
ensure ox_inventory       # or your chosen inventory
ensure 5code-loadouts

The full steps are in the install guide (opens in a new tab).

Step 1: decide who gets access

Three settings decide who can do what at the armory.

Who can do what at the armory
RoleHow it is setWhat they get
OfficerThe job named in Config.JobThe armory NPC, and the loadouts of the unit their grade belongs to
BossA grade listed in Config.BossGradesEvery unit, and the management tabs: build loadouts, map grades to units, change settings
AdminThe loadouts.admin permissionThe same as a boss, whatever their grade, plus the VIP switch and the admin commands

Config.Job is a single job name; the docs show it as police. Only players with that job see the interaction at the NPC. Three tabs of the menu, Activities, Database and Settings, only show for boss grades and admins.

An admin gets the permission with one line in server.cfg:

server.cfg
add_ace identifier.license:YOUR_LICENSE_HERE loadouts.admin allow

Step 2: choose your units

Seven units come configured: Patrol, K9, SWAT, Detective, Air Unit, Sheriff and Command. All of them are editable in game. Every unit has its own name, description, picture and set of loadouts.

The picture at the top of this page is that screen: the dashboard of the armory menu, titled Select Operational Division, with a large Patrol card and three more unit cards to its right.

Step 3: map each grade to a unit

Officers see the loadouts of the unit their grade belongs to. Bosses and admins see every unit. The grade map is what keeps, say, a new cadet on the Patrol kits and away from the SWAT ones.

Two config keys feed it:

  • Config.GradeNames must match the grades defined in your framework job.
  • Config.DefaultGradeMap is only a seed, used on the first start. After that, the mapping is managed live from the in-game menu and stored in the database.

So write the seed before the first start if you can. After that, bosses and admins map grades to units in game, without a restart. The Settings page lists every unit with its grades.

Step 4: build the kits for each unit

Bosses build each unit's loadouts in game. A unit can hold several loadouts, and bosses create, edit and reorder them. Each loadout lists its item count, total weight and required grade.

The Select Loadout screen of the armory menu on a tablet. A SWAT Senior Officer kit is selected, Sergeant and Captain kits sit beside it, and a Confirm Loadout button is at the bottom right.
Each kit shows its items, weight and required grade.

Each item in a loadout is an equipment entry. The docs list its fields on the Equipment setup page; these are the ones to plan per unit:

Fields of an equipment entry
FieldWhat it holds
itemThe inventory item name to give. It must be a registered item on your server
amountThe quantity given on deploy
depositThe deposit for this one item
allowedUnitsThe unit IDs that may take this item
categoryThe group the item is shown under in the menu

Loadouts and single items can also be flagged as VIP. One admin-only switch turns VIP on or off for the whole armory.

Step 5: set the deposit and the penalty

A deposit leaves the officer's bank on deploy and comes back on return, minus a penalty for anything that is missing. Two settings shape it:

  • Deposit multiplier. It scales every per-item deposit globally.
  • Missing-item penalty. What is kept for each missing item on return.

Both are changed on the Settings page and apply without a restart. The deposit comes from the bank, not from cash, so an officer needs enough in the bank to cover it.

What a shift looks like for an officer

  1. Walk up to the armory NPC and open it, with qb-target, ox_target or the E key.
  2. Pick the unit, then a loadout.
  3. Press Confirm Loadout. The deposit leaves the officer's bank and the gear lands in their inventory.
  4. Go back to the NPC and return the loadout. The script checks which items are still in the inventory, and the deposit comes back, minus the penalty for anything missing.

Three rules hold that loop together:

  • One kit at a time. An officer cannot take a second loadout until the first one is returned at the armory.
  • Only two things close a deployment: a return at the NPC, or an admin's force-close. Logging off, dying or dropping items does not close it.
  • A disconnect is tracked. Log off holding a kit and the deployment stays open. Command is notified on Discord, and the officer sees a reminder at the next login.

Several stations, one armory

Place an NPC at each station, with an optional map blip. Every NPC opens the same armory, so a department with more than one station sets up its units and kits once. Several armory NPCs from one list, and the optional blip per NPC, came with version 1.2.0.

Keeping count: the log and the admin commands

Every action is logged in game and to Discord. The activity log shows deploys, returns and emergencies, with search, filters and pages: search by officer, badge or citizen id, and filter by unit and action.

For a deployment that is stuck, admins have two commands. The first shows an officer's open deployment, and the second closes it:

Admin commands
/loadouts:status <citizenid>
/loadouts:forceclose <citizenid> [refund|penalty|none]

The last word of the second command decides what happens to the deposit: refund closes the deployment with a full refund, penalty with a penalty, and none with no refund. Both commands need the loadouts.admin permission.

Where to go next

The Loadouts page shows the in-game menu, including its pages side by side: the dashboard, the loadouts, the activity log and the settings. Loadouts is €30, one-time, and the public docs (opens in a new tab) have 25 pages for it, among them the install guide, the equipment setup and an officer guide.

5CODE also makes Recognition, the script that gives every character a memory of the people they meet. How character recognition works explains the scan and what staff can see. Recognition requirements and supported frameworks lists what a server needs, including the police jobs and MDTs it supports.

Keep reading, 2