Events
A list of available events to interact with cd_garage from your scripts.
Note
These events are entirely optional and can be triggered as needed to integrate cd_garage with your own scripts or custom systems.
Client
Client-Side Events
Defined with
RegisterNetEventin client files.Triggered using
TriggerEvent(if from client) orTriggerClientEvent(if from server).Run only on one player’s game client (the player’s PC).
Mileage
Sends a notification displaying the mileage of the vehicle you are in.
Impound Vehicle
Opens the impound UI. You can send a vehicle’s ID as the first argument; otherwise, it will automatically select the closest vehicle.
Transfer Vehicle
Transfers the vehicle you are currently sitting in to another player.
Toggle Vehicle Lock
Toggles the lock state of the closest vehicle to the player.
Set Vehicle Locked
Locks a vehicle using the garage’s built-in key system. You must send the vehicle’s ID in the first argument.
Set Vehicle Unlocked
Unlocks a vehicle using the garage’s built-in key system. You must send the vehicle’s ID in the first argument.
Update Garage Type
Updates the vehicle’s garage type in the database based on your current vehicle.
Impound Vehicle Directly
Impounds a vehicle directly using code without opening the impound UI. Sends detailed data such as the plate, impound location, vehicle properties, and retrieval status.
Set Job Owned Vehicle
Marks the vehicle the player is currently sitting in as either a personal or society owned job vehicle. This event must be triggered while the player is inside the vehicle.
Open Property Garage
Opens the garage UI from a property script.
Store Vehicle Property Garage
Stores the player's vehicle from a property script.
Add Keys
Gives the player keys for a specific vehicle based on its plate.
Remove Keys
Removes the player's keys for a specific vehicle based on its plate.
Show Keys UI
Opens the vehicle keys UI for the player, displaying all vehicles they currently have keys for.
Server
Server-Side Events
Defined with
RegisterServerEventandAddEventHandlerin server files.Triggered using
TriggerEvent(if from server) orTriggerServerEvent(if from client).Run on the server, not on any individual player’s game client.
Save Mileage Timer
Saves the mileage data for all vehicles currently tracked by cd_garage. Typically used before a server restart.
Save Vehicle Damage Timer
Saves the damage data for all vehicles currently tracked by cd_garage. Typically used before a server restart.
Save Impound Timer
Saves all active impound timers to the database, ensuring impounded vehicle durations are correctly updated and persistent.
Set Garage State
Updates the vehicle’s “in garage” status in the database.
Add Owned Keys
Used when adding an owned vehicle to a player’s garage. This ensures the new vehicle appears in the player’s keys UI.
Add Persistent Vehicle
Used to mark a vehicle as persistent, allowing it to automatically save and respawn if it despawns while the server is running.
Remove Persistent Vehicle
Used to remove a vehicle from the persistent system, preventing it from saving or respawning automatically.
Plate Changed Persistent Vehicle
When a vehicle’s plate is changed while persistent vehicles are enabled, the old plate must be removed from the persistent system. This prevents the vehicle from being saved or respawning using its previous plate.
Last updated
Was this helpful?

