v1.7.0 minor
Divisions, and every law enforcement job can search and jail
8changes

Divisions, and every law enforcement job can search and jail
8changes

[02] Release
Departments can now have divisions: Detective Bureau, SWAT, Traffic, K-9 and Air Support ship ready with their own HD patch, and you can create your own in Admin → Divisions. An officer keeps their job and rank, is added to divisions from their profile in Agents, and each division shows or hides tablet tabs on top of the rank. Also fixed: player search, jail and the logs only worked for a job named exactly "police", one character with no name made every ESX search fail, and the search only looked at the first 50 characters.
Replace every file in the resource. The NUI, all fifteen translations and fxmanifest.lua changed (it loads a new shared file), so drop the whole folder in.
What to keep from your current install: anything you edited under config/ and custom/. This release changes files under custom/, so merge your edits into the new copy of these rather than keeping your old file:
server/custom/framework/esx.lua, qb.lua, qbx.lua — player search, jail and unjail check the tablet modules instead of the job name, and the search is done in the databaseserver/custom/sql_auto_inst.lua — creates the new qs_police_division_members tableNew files, nothing to merge:
shared/divisions.lua, server/modules/divisions/, client/modules/divisions/ — divisionsweb/build/divisions/ — the five patches that shipNothing under config/ changed.
One new table, qs_police_division_members, created on its own at the first boot. Nothing to run by hand.
Admin → Divisions lists the divisions of every job: name, short code, colour, description, patch (pick one of the five that ship or paste any image URL) and a grid of tablet modules — tick to show a module the rank does not have, cross to hide one it does. When two divisions disagree, hidden wins.
Supervisors who can manage employees open an officer's profile in Agents and switch divisions on and off; the officer's tablet changes at once, and the patches appear beside their name in the list. Divisions only count for the officer's current job, so changing department never carries SWAT access along.
The five divisions that ship belong to the police job and only grant modules, so on a server where police already has every module nothing changes until you configure them.
Other resources can read them: exports['qs-police-creator']:GetDivisions() on the client, GetPlayerDivisions(source) and IsPlayerInDivision(source, id) on the server.
Officers keep their job and rank and can belong to divisions (Detective Bureau, SWAT, Traffic, K-9, Air Support, or your own). Each division shows or hides tablet tabs on top of the rank, and the server applies the same rule to every action behind them.
Name, short code, colour, job, description, patch and the modules each division shows or hides, with how many officers are in each.
Supervisors who can manage employees switch divisions on and off; the officer's tablet updates at once and the division patches show beside each name in the list.
Detective Bureau, S.W.A.T., Traffic Division, K-9 Unit and Air Support Division, with transparent backgrounds. Any image URL can be used instead.
Player search, the jailed list, jail and unjail only accepted a job named exactly "police", so BCSO, sheriff and other departments got "Failed to fetch players". They now follow the Penalties and Prison modules set per job in the admin panel.
One character with an empty first or last name, usually somebody who left during character creation, made every search answer "Failed to fetch players".
The search read the first 50 rows and filtered them, so anyone after them could never be found. It now searches the whole database on ESX, QBCore and Qbox.
The logs now open for any job set up in the admin panel, and for admins.