Gun Rack
Troubleshooting

Troubleshooting

Most issues come from misconfigured job names, missing item exports, or trying to interact with the wrong vehicle class. Work through the checks below before opening a support ticket.

Common issues

SymptomLikely causeFix
Item is consumed but no stash registeredPlayer wasn't on an allowed job, or vehicle class didn't match.Confirm the player's job is in Config.AllowedJobs. Confirm the vehicle is class Config.AllowedVehicleClass (default 18). The item should not consume on rejected installs — check the client.export hook in ox_inventory/data/items.lua.
Install rejected with "not authorized"Job name mismatch.Job names are case-sensitive and must match the name field in your qbx_core jobs config exactly. Police and police are different.
gunrack_key doesn't open the rackNo rack installed on that plate, or player not inside the vehicle.The civilian must be inside the vehicle, and the rack must already exist for that plate. Confirm with a SELECT * FROM gunracks WHERE plate = ? query.
/removegunrack does nothingStash isn't empty, or player isn't on an allowed job.Empty the stash first. Confirm the player is on-duty for an allowed job.
Multiple racks on the same vehicleSchema enforces UNIQUE on plate; double-install attempts are rejected.If a duplicate row error appears, check for stale rows in gunracks for that plate and DELETE manually.
Lightbar / utility vehicles can be rackedThese props share class 18.Add the model prefix to Config.IgnoredModelPrefixes. The check is a prefix match and case-sensitive.
Stashes empty after restartStash registration didn't run, or the table is empty.Look for [medit8z_gunrack] Registered N gunrack stashes on start. If N is 0 but you expected racks, your DB connection or oxmysql is misconfigured.
Items have no iconPNGs not copied.Copy gunrack.png and gunrack_key.png from medit8z_gunrack/images/ into resources/[ox]/ox_inventory/web/images/, then refresh and restart ox_inventory.

Quick checks

Run through these in order before reporting a bug:

  1. All four dependencies are running and listed before medit8z_gunrack in server.cfg order.
  2. gunrack and gunrack_key exist in ox_inventory/data/items.lua with their client.export hooks intact.
  3. Both PNGs are present in ox_inventory/web/images/.
  4. The gunracks table exists in the database (SHOW TABLES LIKE 'gunracks').
  5. The on-duty job name in qbx_core matches a key in Config.AllowedJobs exactly.
  6. The vehicle being targeted reports the expected class (test with GetVehicleClass or an admin debug menu).

Database inspection

-- List all installed racks
SELECT id, plate, installed_by, installed_at
FROM gunracks
ORDER BY installed_at DESC;
 
-- Force-remove a rack row (only if /removegunrack is unavailable)
DELETE FROM gunracks WHERE plate = 'ABC123';
⚠️

Manually deleting a gunracks row leaves the Ox Inventory stash registered until the next restart. The stash itself is harmless, but if you re-install on the same plate before restarting, the new stash will replace it.

Commands

CommandNotes
/removegunrackUninstall the rack from the current vehicle. Job-locked, empty-only.

There is no chat-level debug command shipped — diagnose via server console output and direct database queries.

Discord support

Stuck after the checks above? Drop into Discord (opens in a new tab) with your server console output, the gunracks row for the affected plate, and a description of the action that failed. Verified bugs are fixed within 7 days of report. Lifetime updates included.