Optional Features

This section explains how the built-in features work and, if needed, how to make them compatible with other resources. These optional features can be configured in [configs/config.lua].

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.

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

Compatible Code Snippets Provided by Codesign

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'

  • 'air'

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.

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.


Changing Garage Names

To rename a garage (for example, change "b" to "PINK MOTEL"), edit the Garage_ID in the Config.Locations section of the configs/config.lua file. The script will automatically update the database for you.


Custom vehicle logos

Credits to @Baby Amnesia for making this tutorial.


Fake Plates

How Do Fake Plates Work?

In the config.lua, you can set the spawn name for the usable fake plate item.

To use it, stand near a vehicle you own and use the item. A random new plate will be generated and applied to your vehicle. The fake plate is persistent — it stays on the vehicle until it’s manually removed.

You or specific jobs (such as the police) can remove a fake plate using the /removefakeplate command.

Built-in Vehicle Keys Required


Gang Garages

How Do Gang Garages Work?

The main difference between job garages and gang garages is how vehicle access is shared.

When a player stores their personal vehicle in a gang garage, any member of that gang can take it out and use it. The vehicle remains available to the gang until the owner retrieves it and stores it back in their personal garage.

However, other gang members cannot store your vehicle in their own personal garages.

Disabled on ESX


Garage Slots

How Do Garage Slots Work?

The garage slots feature lets you control how many vehicles a player can own.

By default, there’s no limit, but you can enable restrictions to set a maximum number of vehicles per player. Players can buy extra slots using in-game commands, and authorized jobs (like car dealers) can sell these extra slots. You can also set custom prices for extra slots, and players can check how many slots they have using a chat command.

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.

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 the Code Does

  • GetGarageCount(source, 'car') → Checks how many cars the player currently owns.

  • GetGarageLimit(source) → Checks the player’s maximum allowed garage slots.

The script adds +1 to simulate the new car purchase and checks if it still fits within the limit. If it does, the purchase goes through. If not, it shows the message:

"garage limit reached"


Job Garages

How Do Job Garages Work?

There are three types of job garages, and each one works differently. You can configure each garage location to use a different method depending on how you want vehicles to be managed.

This garage script does not include a built-in vehicle shop. If you use Personal Owned or Society Owned methods, you’ll need to handle that setup yourself.

TL;DR – Job Garage Types

  • Regular: Shared job vehicles that are spawned in and not owned by anyone. Simple and no database setup needed.

  • Personal: Vehicles bought by individual players that only they can access from their job garage.

  • Society: Shared job vehicles that belong to the entire job — any member of that job can use them.

Compatible Code Snippets Provided by Codesign

Type
Ownership
Access
Saved In Database
Best Used For

Regular

None — vehicles are spawned, not owned.

All players with the job.

❌ Not saved.

Shared or temporary job vehicles.

Personal

Owned by the player.

Only the vehicle owner.

✅ Saved with job_personalowned = player’s job name.

Employee-owned job vehicles.

Society

Owned by the job.

All members of the same job.

✅ Saved with identifier = job name.

Shared company or organization vehicles.

Setup: Regular Job Vehicles

Config.lua

Go to config.luaConfig.JobVehicles. Under your job’s Locations, set the method to 'regular'. Then scroll to the RegularMethod section and add the vehicles you want that job to spawn.

Setup: Personal-Owned Job Vehicles

SQL (preferred)

Set this in the same SQL query that inserts the vehicle on purchase:

  • Table: owned_vehicles / player_vehicles

  • Column: job_personalowned

  • Value: player’s job name (string)

👉 View Usage Example Event →

ESX Personal: Example of how a personal owned job vehicle should appear in the database (ESX).
QBCore Personal: Example of how a personal owned job vehicle should appear in the database (QBCore).
Event

You can also assign a vehicle as personal owned using this event while seated inside it.

👉 View SetJobOwnedVehicle Event →

Setup: Society Owned Job Vehicles

SQL (preferred)

Set this in the same SQL query that inserts the vehicle on purchase:

  • Table: owned_vehicles / player_vehicles

  • Column: identifier

  • Value: player’s job name (string)

👉 View Usage Example Event →

ESX Society: Example of how a society owned job vehicle should appear in the database (ESX).
Event

You can also assign a vehicle as society owned using this event while seated inside it.

👉 View SetJobOwnedVehicle Event →


Persistent Vehicles

How Do Persistent Vehicles Work?

The persistent vehicle system automatically saves and respawns vehicles that despawn, even after you leave and rejoin the server. By default, only vehicles spawned from the garage are persistent, but you can make others persistent using the events below. A vehicle’s position is saved when it stays still for more than 5 seconds.

Compatible Code Snippets Provided by Codesign

Possible Modifications Required

👉 View Add Persistent Vehicle Event →

👉 View Remove Persistent Vehicle Event →


Private Garages

How Private Garages Work

Private garages function the same as public garages but can be placed anywhere using a chat command. Only the player who purchases a private garage can see and use it. In the config.lua, you can enable certain jobs (such as real estate) to create and sell private garages to players.

👉 View Chat Command →


Property Garages

How Do Property Garages Work?

Property garages work by opening the garage UI directly from your property script. When a player accesses their property garage, the script simply triggers the event to open the Codesign garage interface, allowing them to store or retrieve vehicles from that location.

👉 View Open Property Garage Event →

👉 View Store Vehicle Property Garage Event →


Vehicles Display Names

Vehicle Display Names and Data Vehicle display data provides key details—such as the vehicle’s name, class, price, and garage tax—used in the garage UI. This information helps ensure accurate and consistent vehicle listings across all garages.

ESX

On ESX, vehicle data is pulled from the vehicles database table, which is standard on most servers. This information is used to display details in the garage UI.

If Config.VehiclesData is enabled, the script will automatically fetch:

  • Vehicle display name

  • Vehicle class

  • Vehicle price

  • Garage tax amount (if Config.VehiclesData.garage_tax is enabled)

This is the simplest way to configure vehicle data for your server.

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

Multiple “vehicles” Tables

If your server uses multiple vehicles tables (for example, donator or emergency vehicles), add each table name to Config.VehiclesData.VehicleDatabase_TableNames in your config.lua file.

QBCore

On QBCore, vehicle data is retrieved from qb-core/shared.lua → QBShared.Vehicles, which is standard on most QBCore servers. This data is used to display information in the garage UI.

If Config.VehiclesData is enabled, the script will automatically pull the vehicle’s display name, class, price, and garage tax amount (if Config.VehiclesData.garage_tax is enabled) from shared.lua. This provides the simplest way to configure vehicle data for your server.

Disabled

If Config.VehiclesData is disabled, the script will instead retrieve vehicle display names from the vehicle handling files (vehicles.meta) — for example: <gameName>Adder</gameName>. However, vehicle classes and prices will not be shown in the garage UI, and Config.VehiclesData.garage_tax will be automatically disabled.


Vehicle Keys

How Vehicle Keys Work

If you’re using the built-in vehicle keys system, you must trigger a specific event whenever a vehicle is spawned outside of Codesign resources — for example, from a /car command, vehicle shop, or civilian job script. This ensures the player automatically receives the correct keys for that vehicle.

Compatible Code Snippets Provided by Codesign

Vehicle Key Script Conflicts

👉 View Add Keys Event →


Vehicle Plate Format

Last updated

Was this helpful?