Housing Integration for Developers
This page explains how housing developers can make their property garages work with cd_garage.
There are two ways to integrate a housing garage.
Method 1: Housing Script Handles the Interaction
Use this method if your housing script already has its own garage interaction points.
With this method, the housing script handles the interaction, but cd_garage still handles the garage data, vehicle list, vehicle spawning, and vehicle storing.
How it works
- The player uses the garage interaction from the housing script.
- The housing script triggers the
cd_garageopen property garage event. cd_garagechecks if there is already a property garage near the player.- If a property garage exists, it opens that garage.
- If no property garage exists,
cd_garagecreates one using the player’s current location. - When storing a vehicle, the housing script triggers the store vehicle event.
cd_garagestores the vehicle into the nearby property garage.
Recommended
- When opening the garage, send the vehicle spawn coords in the first event argument.
- This allows
cd_garageto use the correct vehicle spawn location. - If no spawn coords are sent, the player’s current coords and heading will be used.
👉 View Open Property Garage Event →
👉 View Store Vehicle in Property Garage Event →
Method 2: cd_garage Handles the Garage
Use this method if you want cd_garage to fully handle the property garage.
With this method, the housing script only needs to create the garage when a player purchases or creates a property.
How it works
- A player purchases or creates a property.
- The housing script triggers the create property garage event.
- The property garage is saved to the
cd_garagedatabase. cd_garagehandles the interaction point, garage UI, vehicle spawning, and vehicle storing.- The garage can also be managed through the
cd_garagesystem.
This is the recommended method for new integrations.