Database
Koja HUD creates no tables of its own. It adds one column to your existing owned-vehicles table, to remember how much nitro each car has left. Player settings are not stored in the database at all — they live in each player's game client.
The nitro column
When oxmysql connects, the server runs:
ALTER TABLE `owned_vehicles` ADD COLUMN IF NOT EXISTS nitro INT DEFAULT 0;
with the table name taken from KOJA.Nitro.Tables.GaragesTable.
It is safe to run on every start: an existing column is left alone.
| Column | Type | Meaning |
|---|---|---|
nitro | INT, default 0 | Nitro left, 0–100. 0 means none installed |
If your database user may not alter tables, add the column yourself with the statement above — on QBCore and QBox the table is player_vehicles.
How it is read and written
| When | What happens |
|---|---|
| A player takes the driver's seat | SELECT plate, nitro for that plate and the player's identifier in OwnerColumn. No row — not the owner — means no nitro |
| Nitro is installed | The same ownership check, then nitro = 100 |
| A boost ends, or the driver gets out | UPDATE … SET nitro = ? WHERE plate = ?, only if the value went down |
Plates are matched both as stored and with surrounding spaces trimmed, because GTA pads plate text to eight characters.
Resetting nitro
-- One vehicle
UPDATE owned_vehicles SET nitro = 0 WHERE plate = 'ABC 123';
-- Everyone
UPDATE owned_vehicles SET nitro = 0;
Removing it
If you stop using nitro, set KOJA.Nitro.Enabled = false — the server side then does nothing, including the ALTER TABLE.
The column can stay; drop it only if nothing else reads it:
ALTER TABLE owned_vehicles DROP COLUMN nitro;