Tech sheet
bnVehicleHistory
Vehicle history and mileage tracking
Version 1.0.0
Compatible ESXQBCoreQboxStandalone
Commands & Permissions
Commands
The UI is the main way to use bnVehicleHistory
Day to day, everything should go through the NUI: open it with
/vehiclehistory or the ox_target option, then use the buttons on the Documents/Modifications tabs to report an accident, log a repair, log an inspection, or review spec. The three action commands below (/reportaccident, /logrepair, /loginspection) exist as a chat-only backup, for when a player can't get NUI focus, is scripting a scenario, or you're troubleshooting without opening the panel. Both paths call the exact same server-side logic and permission checks, so nothing is lost by using one over the other.| Command | Access | Description |
|---|---|---|
/vehiclehistory [plate] | Owner / mechanic / police | Opens the history UI for the given plate, or the vehicle you’re driving if omitted. This is the main entry point. |
/reportaccident [plate] [description] | Police only | Backup for the NUI’s “Report accident” button. |
/logrepair [plate] [service type] [category] [cost] [parts] | Mechanic only | Backup for the NUI’s “Log repair” button. category is one of performance, estetica, suspensao, motor, outro. |
/loginspection [plate] [pass\|fail] | Mechanic or police | Backup for the NUI’s inspection pass/fail buttons, valid for Config.DefaultInspectionValidDays. |
Who can do what
Config.MechanicJobs = { 'mechanic' }
Config.PoliceJobs = { 'police' } | Action | Owner | Mechanic (Config.MechanicJobs) | Police (Config.PoliceJobs) |
|---|---|---|---|
| View own vehicle’s history | Yes | Yes (any plate) | Yes (any plate) |
| View full owner history (previous owners) | Yes, own vehicle | No | Yes, any plate |
| Log a repair | No | Yes | No |
| Report an accident | No | No | Yes |
| Log an inspection | No | Yes | Yes |
| Review vehicle spec (approve/reject tuning) | No | Yes | Yes |
A player who’s neither the owner nor on either job list gets not_authorized for someone else’s plate. Mechanic and police access isn’t limited to their own vehicles by design, that’s what lets a shop or a traffic stop pull up any plate.
Why two different errors
Looking up a plate nobody's ever registered returns
vehicle_not_found, but only to mechanic/police. A civilian gets not_authorized either way, so a plate search can't be used to fingerprint which plates exist in the database.Example roleplay flow
A police officer pulls a car over on a routine stop:
/vehiclehistory ABC1234: the plate isn’t the driver’s own, so the command only works because the officer’s job is onConfig.PoliceJobs. The panel opens showing the full owner history, not just the current one.- The owner history shows two prior transfers and the current owner doesn’t match the driver’s ID. Worth a follow-up question in character.
- The officer notices the front bumper doesn’t match the declared spec and opens the spec review tab. The diff shows an undeclared
modFrontBumperchange. Rejecting it leaves the mismatch on record for later. - Back at the station, the officer runs
/reportaccident ABC1234 rear-ended at the pier: logged with their location, timestamped, and (ifConfig.DiscordWebhookis set) posted to the server’s audit channel.
A mechanic shop handles a walk-in:
/vehiclehistory ABC1234at the lift: the mechanic’s job is onConfig.MechanicJobs, so this works on any plate, not just their own vehicles.- Service history shows the last inspection expired 12 days ago (
Config.DefaultInspectionValidDayshad lapsed). /logrepair ABC1234 "suspension rebuild" suspensao 3500 "coilovers, bushings": logged with the mechanic’s identifier attached./loginspection ABC1234 pass: resets the inspection validity window.
Repair, accident, inspection, and spec review all need you near the vehicle
Recording any of those four through the command or the NUI requires a live reading of the actual vehicle: you (or the vehicle) must be within 5 meters and the plate has to match. Too far away and the action fails with
not_near_vehicle, that's not a permission bug. Trusted export calls (no player source, see Exports) skip this check.