Skip to content

Features

Boat & Air garages

How Do Boat & Air Garages Work?

When a player purchases a boat or aircraft, you'll need to update the garage_type field in the database for that vehicle.

Resource Integrations


Using boat, helicopter, or plane garages?
Follow these setup guides to make selected scripts add non-car vehicles correctly

Need vehicle type events?
Use these events to let other scripts register boats, helicopters, or planes with the correct garage vehicle type

View UpdateGarageType Event

INFO

If your server doesn't use boats or aircraft, you can skip this step, the default garage_type is set to "car".

Option 1: SQL Method (Server-Side)

Ideally, the garage_type should be set in the same SQL query that adds the vehicle to the database when it's purchased for example, in your vehicle shop script.

The garage_type value must be a string and can only be one of the following:

  • 'car'
  • 'boat'
  • 'heli'
  • 'plane'

For example, to make a boat appear in the boat garage, edit the SQL query in your vehicle shop to insert 'boat' into the garage_type column of the owned_vehicles or player_vehicles table.
Do the same with 'air' for aircraft.

You don't need to do this for cars or bikes the default garage_type is already set to 'car'.

Option 2: Event Method (Client-Side)

You can trigger this client-side event to automatically update the garage_type in the owned_vehicles/player_vehicles database table.

lua
TriggerEvent('cd_garage:UpdateGarageType')

This event is triggered from the client side but handled on the server, meaning you can call it after a player purchases a vehicle to ensure the correct garage type is saved automatically.


Custom vehicle logos

Credits to @Baby Amnesia for making this tutorial.

https://www.youtube.com/watch?v=LR9pF1GM61U


Fake Plates

How Do Fake Plates Work?

  • Set the usable fake plate item name in the in-game Config UI.
  • Stand near a vehicle you own and use the fake plate item.
  • A random new plate will be generated and added to the vehicle.
  • The fake plate is saved and will stay on the vehicle until it is removed.
  • The vehicle owner or allowed jobs, such as police, can remove the fake plate using /removefakeplate.

Built-in Vehicle Keys Required


Fake plates only work with the built-in vehicle key system.


Gang Garages

How Do Gang Garages Work?

  • Gang garages let gang members share access to stored vehicles.
  • When a player stores their personal vehicle in a gang garage, other members of the same gang can take it out and use it.
  • The vehicle stays available to the gang until the owner takes it out and stores it back in their personal garage.
  • Other gang members cannot store another player's vehicle in their own personal garage.

Disabled on ESX


  • Gang garages are only available on QBCore or QBox.
  • ESX treats gangs as normal jobs, so gang garages are not used.
  • If you use ESX, use job garages for gang-related vehicles instead.

Garage Slots

How do garage slots work?

  • Garage slots let you control how many vehicles a player can own.
  • You can enable garage slots to set a maximum vehicle limit for each player.
  • Players can buy extra slots on the UI at any public garage location.
  • You can set the price for extra slots in the config.
  • Players can check how many slots they have on the UI at any garage location.
Usage Example (Server-Side Only)

Place this code in your vehicle shop resource.
It checks if a player has enough garage slots before allowing them to buy another vehicle.

lua
if exports['cd_garage']:GetGarageCount(source, 'car') + 1 <= exports['cd_garage']:GetGarageLimit(source) then
    print('allow purchase') -- Player has space, allow the purchase
else
    print('garage limit reached') -- Player is at their limit, deny the purchase
end

What does this code do?

  • GetGarageCount(source, 'car') checks how many cars the player currently owns.
  • GetGarageLimit(source) checks how many garage slots the player is allowed to have.
  • The code adds +1 to include the vehicle the player is trying to buy.
  • If the new total is still within the player's garage limit, the purchase is allowed.
  • If the player has reached their limit, the purchase is blocked and shows:

garage limit reached


Job Garages

How do job garages work?

  • Job garages can be set up in three different ways.
  • Each garage location can use a different job garage method.
  • Choose the method based on how you want job vehicles to be owned and shared.
  • This garage script does not include any way to purchase job vehicles.
  • If you use Personal Owned or Society Owned vehicles, you must handle the vehicle purchase/setup yourself.

Job Garage Methods

Regular

  • Shared job vehicles that are spawned from the garage.
  • These vehicles are not owned by any player or society.
  • No database vehicle setup is needed.

Personal Owned

  • Job vehicles owned by individual players.
  • Only the vehicle owner can access their own job vehicle from the job garage.

Society Owned

  • Job vehicles owned by the job/society.
  • Any allowed member of that job can access and use them.
MethodOwnershipAccessSaved In DatabaseBest Used For
RegularNone, vehicles are spawned, not owned.All players with the job.falseShared or temporary job vehicles.
PersonalOwned by the player.Only the vehicle owner.trueEmployee-owned job vehicles.
SocietyOwned by the job.All members of the same job.trueShared company or organization vehicles.

Setup: Regular Job Vehicles

  • Shared job vehicles that are added and configured in the in-game Config UI.
  • These vehicles are managed from the Job Locations page.

Setup: Personal-Owned Job Vehicles

SQL (preferred)
  • Set this value in the same SQL query that creates the vehicle after purchase.
  • Table: owned_vehicles or player_vehicles
  • Column: job_personalowned
  • Value: the player's job name as text

View Example

![](/images/personal.png)

**This image shows how the owned_vehicles / player_vehicles database table should look for a personal owned job vehicle.**

sql
local plate = 'ABCD1234'
local job  = 'police'

exports.oxmysql:execute('UPDATE player_vehicles SET job_personalowned=@job WHERE plate=@plate', {
    ['@job'] = job,
    ['@plate'] = plate
})

INFO

The examples above are from a QBCore server. The SQL query or database structure may be different depending on your framework.

Event

You can also assign the vehicle you are sitting in as a personal owned job vehicle using this event.

View SetJobOwnedVehicle Event

Setup: Society Owned Job Vehicles

SQL (preferred)
  • Set this value in the same SQL query that creates the vehicle after purchase.
  • Table: owned_vehicles or player_vehicles
  • Column: job_societyowned
  • Value: a table/list of allowed job names

View Example

This image shows how the owned_vehicles / player_vehicles database table should look for a society owned job vehicle.

sql
local plate = 'ABCD1234'
local job  = {
    'police',
    'sheriff',
    'bcso'
}
exports.oxmysql:execute('UPDATE player_vehicles SET job_societyowned=@job WHERE plate=@plate', {
    ['@job'] = json.encode{job},
    ['@plate'] = plate
})

INFO

The examples above are from a QBCore server. The SQL query or database structure may be different depending on your framework.

Event

You can also assign the vehicle you are sitting in as a society owned job vehicle using this event.

View SetJobOwnedVehicle Event

Persistent Vehicles

How do persistent vehicles work?

  • Persistent vehicles are saved and respawned automatically if they despawn.
  • They can also respawn after a player leaves and rejoins the server.
  • By default, only vehicles spawned from the garage are persistent.
  • Other vehicles can be made persistent using the events below.
  • A vehicle's position is saved after it stays still for more than 5 seconds.

Resource Integrations


Using built-in persistent vehicles?

Follow these setup guides to make selected scripts delete vehicles correctly

Using another persistent vehicle script?

View persistent vehicle scripts that already work through our bridge

Integration Events

Use these events to make other scripts work with the built-in persistent vehicle system.

View Add Persistent Vehicle Event

View Remove Persistent Vehicle Event

Possible Modifications Required


  • If this feature is enabled, add the event below to any external resource that removes vehicles.
  • This includes resources such as /dv commands, impound scripts, or plate changing scripts.
  • If the event is not added, the deleted vehicle may respawn automatically.

Private Garages

How do private garages work?

  • Private garages can be created by admins using the in-game configurator.
  • They can also be created by code using an event.
  • Property scripts should use the event method to create property garages automatically.
  • Each private garage can have one main owner.
  • Other players can also be added and allowed to access the garage.

Vehicles Model Data

  • Vehicle model data controls what is shown in the garage UI.
  • This includes details such as the vehicle name, class, and price.
  • The vehicle price is also used to calculate percentage-based fees, such as:
    • Return vehicle fees
    • Garage tax
    • Impound fees
  • This means more expensive vehicles can cost more to return, tax, or retrieve from impound.
  • If the vehicle price cannot be found, the script will use the fallback price from the config.
  • The vehicle label is also loaded from this data.
  • If no label is found, the script will use the default game name from vehicles.meta.
ESX
  • On ESX, we pull vehicle model data from the vehicles database table.
  • This is the easiest way to set up vehicle model data on ESX servers.

The "vehicles" database table, commonly used on ESX servers.

Multiple vehicles Tables

  • If your ESX server uses multiple vehicles tables, you can add them in cd_bridge/shared/config.lua.
  • This is useful for servers with extra vehicle tables, such as donator vehicles or emergency vehicles.
  • Add each table name to ESXVehiclesTables.
  • The bridge will check these tables when loading vehicle data.
QBCore
  • On QBCore, we pull vehicle model data QBShared.Vehicles in qb-core/shared.lua.
Fallback data if vehicle cannot not found in vehicle model data
  • If vehicle model data cannot be found, the script will try to get the vehicle display name from the vehicle handling files, such as vehicles.meta.
  • For example, if the vehicle has <gameName>Adder</gameName>, the script will use Adder as the display name.
  • The vehicle price will use the fallback price set in the in-game configurator.

Vehicle Keys

How do vehicle keys work?

  • If you use the built-in vehicle key system, keys are given automatically for vehicles spawned by Codesign resources.
  • If a vehicle is spawned by another resource, such as a /car command, vehicle shop, civilian job script, or similar resource, you must trigger the key event yourself.
  • This makes sure the player receives the correct keys for that vehicle.

Resource Integrations


Using built-in vehicle keys?

Follow these setup guides to make selected scripts give keys correctly

Using another key script?

View key scripts that already work through our bridge

Integration Events

Use this event to make other scripts give players keys when using the built-in vehicle key system.

View Add Key Event

View Remove Key Event

View Add Owned Key Event

Vehicle Key Script Conflicts


  • If you use the built-in vehicle key system, remove or disable all other vehicle key scripts to prevent conflicts.
  • Make sure the other key scripts are fully stopped, as some resources can still start automatically if they are listed as dependencies, even if they are removed from your server start config.

Vehicle Plate Format

PLEASE READ CAREFULLY!


You must complete this step correctly. You must read the information below and confirm your server's plate format.

Please read all 3 options below carefully before confirming which one you use.

Please note that you NEED to use the plate format your server already uses; changing them just because you like the benefits can cause script-breaking issues.

What is vehicle plate formats?

Your vehicle shop/car dealer is the script that usually decides what plate format owned vehicles will use on your server. So you need to configure the Config.PlateFormats in the [configs/config.lua] file to what plate format your server uses. We have added compatibility with all 3 known plate formats.

Short Explanation

By default, every vehicle's plate in FiveM is 8 characters long. So for example if your vehicle shop forces the plate to be 4 characters long, when you use the FiveM native to get a vehicle's plate GetVehicleNumberPlateText(vehicle), this will return a string that is 8 characters long even though the plate is 4 characters long on your vehicle in-game (ABCD); because FiveM will add whitespaces until the plate is 8 characters long including whitespaces.

To sum up the above:


Do you use QBCore or QBox?

Use the "mixed" option.

Do you use esx_vehicleshop, and are your plates formatted like [ABC 123]?

Use the "mixed" option.

My plates are 8 characters with no spaces [ABCD1234]?

Use the "mixed" option.

Hello!