🚗 Plate Changer

Plate Changer

This is a step-by-step installation guide, configuration preview, and full explanation of all settings for legends_platechanger.

⚠️

If you lack programming experience, ensure you read each step thoroughly without skipping, as all documentation is essential!

Before submitting a support ticket or following the guides in this documentation, please make sure that you are running the latest version of the resource.

What is legends_platechanger?

legends_platechanger is a multi-framework vehicle license plate changer that allows players to customize their vehicle plates. It features automatic framework detection, an NPC purchase system, and comprehensive compatibility across different targeting and inventory systems.

Key Features

  • Multi-Framework Support - Compatible with QB-Core, QBX-Core, and ESX frameworks
  • Multi-Target System Support - Works with ox_target, ox_lib, and qb-target
  • Multi-Inventory Support - Compatible with ox_inventory, qb-inventory, and esx_inventory
  • Auto-Detection - Automatically detects available frameworks and systems
  • NPC Purchase System - Buy license plates from configurable NPCs
  • Job Requirements - Optional job restrictions for plate changing
  • Vehicle Ownership Validation - Ensures only vehicle owners can change plates
  • Plate Validation - Checks for duplicate plates across the database
  • Localization - Multi-language support via JSON locale files

Need help? Join our Discord (opens in a new tab) for support!

FAQ

How do I change the accepted plate format (e.g. allow 8 chars, block numbers)?

Open config.lua and edit Config.PlateRegex. Any valid Lua pattern works, e.g. "^[A-Z0-9 ]+$" for alphanumeric with spaces. The server validates every submitted plate against the pattern before writing to the database, so invalid formats never reach the vehicle.

How do I restrict plate changes to a specific job (e.g. mechanic only)?

Set Config.JobRestricted = true and list the allowed jobs in Config.AllowedJobs = { "mechanic", "dmv" }. The server checks PlayerData.job.name (QB/QBox) or xPlayer.getJob().name (ESX) before processing the purchase, returning a locale-ready error if the player is not whitelisted.

How does the resource prevent duplicate plates across the server?

Before writing a new plate the server runs a SELECT over oxmysql on your framework's player_vehicles or owned_vehicles table (configurable via Config.PlateTable). If a row already exists the purchase fails and the player's money is refunded atomically. The check is job-agnostic so it catches alt characters too.

Can I change the NPC model, location or let players run the shop mobile?

Yes. Config.NPC accepts a ped model, coords, heading and scenario. You can spawn multiple NPCs by appending entries. For a mobile/event shop call exports.legends_platechanger:SpawnNpc(coords) from your event script; a matching DespawnNpc export removes it when the event ends.

How do I refund or force-change a plate via an admin command or custom workflow?

exports.legends_platechanger:ForceChangePlate(playerId, vehicleNetId, newPlate) bypasses validation, price and uniqueness checks. It still writes to the database and updates the live entity. Pair it with your existing admin menu or a support dashboard for refund/rename requests.


Legends Store - Premium FiveM Scripts