XyraLScripts
Installation guide

XS-PoliceSystem

The whole police job for Qbox and QBCore. Stations, a jail and impound lots you build in game, a quick action wheel that never takes the mouse, forensics, body cams and police dogs.

01

Requirements

  • ox_lib and oxmysql
  • Qbox (qbx_core) or QBCore (qb-core)

Everything else is found on its own: your target, appearance, vehicle keys, banking and dispatch scripts, and your MDT. pma-voice gives body cams sound, and screenshot-basic saves booking mugshots.

XS-PoliceSystem replaces qbx_police, qb-policejob and qb-prison. Do not run it alongside them.

02

Installation

  1. Stop qbx_police, qb-policejob and qb-prison and take them out of server.cfg.
  2. Drop XS-PoliceSystem into your resources and add ensure XS-PoliceSystem after ox_lib and oxmysql.
  3. Give your staff the builder: add_ace group.admin xs.police.admin allow.
  4. Paste items/ox_inventory.lua into ox_inventory/data/items.lua and items/ox_inventory_weapons.lua into the Weapons table in ox_inventory/data/weapons.lua. On QBCore, paste items/qb_core.lua into qb-core/shared/items.lua. Replace any entries with the same name.
  5. Copy inventory_images/*.png into your inventory's image folder.
  6. Restart, then run /policebuilder in game.

The tables are made on first start. There is no SQL to run.

Police are anyone with a job named police, lspd, bcso, sasp, sast or ranger, or a job of type leo. Change that in Config.Jobs.

03

The builder

/policebuilder opens the builder. The Overview shows how far your setup has got, lists anything missing with a button straight to it, and sets up a whole place in one click: Mission Row PD, Paleto Bay Sheriff or Bolingbroke Penitentiary.

  • Every place has a Layout tab with a plan of its points to scale, and a Live switch that hides it without deleting it.
  • Points are placed with a free camera or at your own feet.
  • Settings holds about 150 options from config.lua. Saving puts them live for everyone, no restart.
  • Ctrl+K searches places and settings, and Walk the site hides the builder so you can walk around with every point labelled.
04

Stations

A station can have any of these points:

  • Duty: clock in and out
  • Locker room: outfits and your own locker
  • Armory: weapons and gear by rank, with a photo of every item
  • Garage and helipad: cars and helicopters by rank, with liveries and extras
  • Evidence: numbered lockers from 1 to 9999, each with a case note
  • Booking: send a cuffed suspect to jail and take a mugshot
  • Boss office: roster, ranks, callsigns, hours, records, the armory, the garage, the account and the activity log
  • Camera room: live body cams and dash cams of every officer on duty
  • Forensic lab: work the evidence bags officers bring in

Options picks which departments use the station and its plate prefix. Leave every department unticked and all of them can use it.

05

The action wheel

On duty, press F6. The wheel sits at the side of the screen and does not take the mouse, so you keep walking and looking around while it is open. Scroll or press 1 to 9 to pick, left click to use, right click to go back.

Cuff, escort, search, seize cash, check ID, GSR test, Prints & DNA, licences, seat in a car, run a plate, impound, cones, barriers, spike strips, fines, jail, the K9, your MDT and a panic button are all on it.

Pick Quick action wheel in the builder to change it: reorder entries, move them between menus, rename them, change icons, keep actions to some departments and ranks, and add your own actions that run a command or an event. Officers press G on an action to pin it to the front of their own wheel.

06

Forensics

Shooting leaves bullet casings with the gun's serial, getting hurt leaves blood, and robbery scripts that use qb-policejob's evidence events leave fingerprints. On-duty officers see evidence in the beam of a flashlight and press E to bag it.

  • People without gloves leave prints on their casings and on cars they get into. Dust for prints on the wheel lifts them.
  • The forensic lab at a station names who the DNA and prints belong to, and who carries the gun a casing came from.
  • Prints & DNA on the wheel scans a restrained suspect, shows any matching bags you carry, and copies the codes or opens their MDT profile. Gloves block the scan until they come off.
  • Bleach cleans up blood, casings and prints.

Already run the evidences script? Config.Bridges.evidence = 'auto' uses it when it is running and ours otherwise.

07

Cameras, radar and the helicopter

  • Body cams and dash cams: every officer on duty has a body cam, and every station car has a dash cam and a back seat camera. Watch them from a camera room. With pma-voice you hear what the officer hears. Supervisors can watch from the wheel and the MDT too.
  • Security cameras: the 34 bank and store cameras from qb-policejob, with the same numbers robbery scripts send. /cam 22 opens one.
  • Helicopter camera: press E in a police helicopter. Day, night and thermal vision, lock-on with plate and speed, a spotlight and rappelling.
  • Radar: F5 in a police car for front and rear speeds and a plate reader. Flagged plates beep.
  • Speed cameras: the 11 from qbx_police, off by default in Config.SpeedCameras.
08

Police dogs

Call a dog from the wheel (Scene, then K9). Every command works on the person or car you are looking at.

  • Sniff: walks round a car or person and sits on anything in Config.K9.find
  • Track: finds the nearest person who is not police and barks
  • Send dog: goes after the person for a few seconds
  • Guard: sits by a suspect and takes them down if they run
  • Bark, Follow / stay and In / out of car

Config.K9 sets the rank and departments that can have a dog, and the ranges.

09

Jail and prison life

A sentence is in months, and one month is one minute by default (Config.Jail.minutesPerMonth). Time only counts while the prisoner is online. Logging out or crashing saves the time left, and they go straight back to a cell when they log in.

Build a prison with cells, a canteen, workout stations, a release point, guard posts, a commissary, an inmate trader, a workbench, hidden stashes, tunnels and weak fences. Prison jobs take time off and pay commissary credit.

  • Belongings are taken at the door and handed back on release.
  • Every cell has a stash under the mattress that stays between sentences.
  • Anything picked up inside stays in the prison at release (Config.Jail.releaseClear).
  • Guards pat down inmates near their posts and take contraband.
  • Tunnels are dug with a spoon, and fences are cut with wire cutters. Getting out sets off the prison alarm.
10

Impound lots

Build a lot with a release desk and parking bays. When an officer impounds a car from the wheel, they pick the lot, the hold time, the fee and a reason. A police hold keeps the car until an officer clears it.

Owners pay at the desk, and the car is parked for them in a free bay with its keys. With no lot built, impounding sends the car to your garage script's depot instead.

Held cars are kept out of qb-garages and qbx_garages until collected. Garage scripts with their own impound columns may still list them. Set Config.Impound.heldState if yours needs a different value.

11

Your other scripts

There is nothing to move from qbx_police, qb-policejob or qb-prison. Cuffs, jail time and criminal records are kept in the same place, and the old events and exports still answer, so robbery scripts, radial menus, phones, inventories, medical scripts and MDTs keep working.

Nothing a client sends can take cuffs off or shorten a sentence.

The MDT button on the wheel opens XS-MDT, ps-mdt, redutzu-mdt, kartik-mdt, tk_mdt, drx_mdt, CodeM, origen_police, qs-dispatch, lb-tablet or qb-mdt. With XS-MDT 3.1 or newer, the two share flagged plates and BOLOs, mugshots, custody and warrants.

12

Troubleshooting

/policebuilder does nothing

You do not have access. Run add_ace group.admin xs.police.admin allow.

Officers cannot clock in

There is no station with a duty point yet. Open /policebuilder and start from Mission Row PD on the Overview.

F6 does nothing

You are not on duty, or your job is not in Config.Jobs. Clock in at a duty point first.

Using handcuffs or bleach does nothing

On ox_inventory, the client export line is missing from the item. Paste the items from items/ox_inventory.lua as they are.

The armory shows plain icons instead of photos

Your inventory's image folder was not found. Set Config.Armory.images to your folder.

Officers cannot see any evidence

Evidence shows in the beam of a flashlight. Turn one on, or set Config.Forensics.flashlight to false.

Body cams have no sound

Sound comes through pma-voice. Without it, the cameras still work with no audio.

Mugshots are not saved

Mugshots need screenshot-basic running.

Something else is not working

Run /policediag in game. It shows what XS-PoliceSystem picked up, so include it when you ask for help on the Discord.

13

Updating

  1. Back up the database first.
  2. Keep a copy of your edited config.lua.
  3. Replace the resource folder, merge your config back and restart.

Your stations, prisons, impound lots, wheel and settings live in the database, so nothing you built is lost.

14

Support

Bugs and questions go to the Discord. Include your server's console output — the resource prints the reason when it refuses to do something, and that line is usually the whole answer.

XS-PoliceSystem on GitHub