gta6/prompts
vehicles
Coreadvancedvehicles

Vehicle Persistence: Save Mods and Plate

Persist a QBCore vehicle's full mod set and plate to the database as JSON, then re-apply every property on a later spawn.

NON-TESTÉ — the reference Lua is syntax-validated, not run in a live FiveM server. Adapt and test on your own dev server before shipping.
Est. Lua
~56 loc
Claude
Claude Opus 4.x / Sonnet 4.x
Validation
syntax-validated
Updated
2026-06-24

Description

A persistence layer for QBCore vehicles: /savecar captures the complete mod set (engine, transmission, wheels, color, extras, neons, plate) via QBCore's property helpers, serializes it as JSON to player_vehicles.mods, and /loadcar <plate> re-spawns the car with every modification restored exactly. This is what makes a tuned car still tuned after a server restart.

Prompt Template

You are writing a FiveM resource for QBCore. ONE Lua file, client + server sections…

🔒 Eyes-only — locked prompt body

The full prompt template and its reference Lua are part of a one-time pack. Pick your depth — both are lifetime access, no subscription, ever.

Core$49one-time
  • 60 prompts + syntax-validated reference Lua
  • Lifetime access — pay once
Most Popular · Best Value
Vault$199one-time
  • All 510 prompts — the full library
  • Per-prompt profit/trend intelligence (CSV + playbook)
  • Lifetime free updates — new niches as the market moves
Get the Vault — $199

$49 for 60 · $199 for all 510 + intelligence — one-time, no subscription.

Expected Output

The reference Lua at content/expected-outputs/vehicles/06-vehicle-persistence.lua implements /savecar (capture + encode + UPDATE) and /loadcar (SELECT + spawn + decode + apply). fxmanifest splits…

🔒 Eyes-only — locked prompt body

The full prompt template and its reference Lua are part of a one-time pack. Pick your depth — both are lifetime access, no subscription, ever.

Core$49one-time
  • 60 prompts + syntax-validated reference Lua
  • Lifetime access — pay once
Most Popular · Best Value
Vault$199one-time
  • All 510 prompts — the full library
  • Per-prompt profit/trend intelligence (CSV + playbook)
  • Lifetime free updates — new niches as the market moves
Get the Vault — $199

$49 for 60 · $199 for all 510 + intelligence — one-time, no subscription.

Known Failure Modes

  • Partial mod table — Claude hand-builds a few mod indices and loses color/extras/wheels. Force QBCore.Functions.GetVehicleProperties/SetVehicleProperties.
  • Apply too early — calling SetVehicleProperties before CreateVehicle finishes does nothing; require ordering after the spawn loop.
  • Unserialized store — passing the Lua table straight to the column corrupts it; mandate json.encode client-side and store the string.
  • Missing columnplayer_vehicles.mods must exist as LONGTEXT; note the schema requirement.

Integration Notes

client.lua + server.lua; fxmanifest.lua includes @oxmysql/lib/MySQL.lua and dependencies { 'qb-core', 'oxmysql' }. Ensure player_vehicles.mods is LONGTEXT. Test: spawn a car, mod it at a tuner, /savecar, restart the resource, /loadcar <plate>, and confirm every mod returns.

Profit Potential

$320–$4400/mo on Tebex (expected ~$1150). [INFERRED] Advanced persistence infrastructure commands a premium; it sits in the upper $50-389 band where buyers pay for restart-proof tuning.

Trend Signal

rising — vehicle modding/tuning niche-selection 3.75; corpus ox_fuel active.

Sales Angle

Premium infrastructure — a tuned car stays tuned after a restart via full mod-set and plate JSON persistence. Recommend $179 on Tebex as advanced groundwork.

Difficulty & Ship Time

advanced · ships in 1-2 days.