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.
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.