Overview
sg-garages is a feature-rich garage management system designed for QBCore and QBox servers. It provides everything from basic vehicle storage to advanced features like physical garage previews, job-specific vehicle management, and a comprehensive impound system with authorization levels.
Framework
QBCore / QBox (Auto-detect)
Version
3.0.0
Features
Core Features
- Multi-Framework Support - Auto-detects and supports both QBCore and QBox
- Dynamic Garage Management - Create, edit, and delete garages in-game with admin commands
- Vehicle Storage - Store and retrieve vehicles with full customization preservation
- Vehicle Sharing - Share vehicles with other players temporarily
- Transfer System - Transfer vehicles between garages with configurable fees
- Physical Garage Preview - View your favorite vehicles in a 3D garage space with drive-out functionality
Vehicle Management
- Favorite Vehicles - Mark vehicles as favorites for quick access
- Custom Names - Set custom names for your vehicles
- Vehicle Images - Add custom images for vehicles in the UI
- Damage Preservation - Vehicle damage is saved and restored on spawn
- Fuel Integration - Supports LegacyFuel, ox_fuel, and qb-fuel
- Spawn Method Toggle - Choose between client-side or server-side vehicle spawning
- Smooth Vehicle Spawning - 1-second fade-in effect when vehicles spawn for a polished experience
Garage Types
Car Garages
Standard vehicle storage
Boat Garages
Marina/boat storage locations
Aircraft Garages
Helicopter and plane storage
Job Garages
Job-specific vehicle spawning
Dependencies
Required
oxmysql- Database operationsox_lib- UI and utilitiesPolyZone- Zone detectionqb-coreorqbx_core- Frameworkqb-vehiclekeysorqbx_vehiclekeys- Vehicle keys
Installation
Install Dependencies
Ensure all required dependencies listed above are installed and running.
Database Setup
Run the appropriate SQL file from the install folder:
- -
install_qbcore.sqlfor QBCore - -
install_qbox.sqlfor QBox
Note: Tables are auto-created on first start if they don't exist.
First Time Setup (MANDATORY)
Important: This is required for initial setup, not just migrations.
Config.CopyFromSQL = true -- Set to true in config.lua
-- This installs all preconfigured garages from the SQL file
-- Start the resource
-- Set back to false after installation completesConfiguration
Edit config.lua to customize settings, framework, fuel system, notification provider, etc.
Add to server.cfg
ensure oxmysql
ensure ox_lib
ensure PolyZone
ensure qb-core -- or qbx_core
ensure qb-vehiclekeys -- or qbx_vehiclekeys
ensure sg-garagesConfiguration
Key Config Options
Config.Framework = 'auto' -- 'auto', 'qbcore', or 'qbox'
Config.StoreForPlayer = true -- Allow storing vehicles for other players
Config.ApplyDamages = true -- Apply visual damage when spawning
Config.SharedGarage = false -- Access vehicles from any garage
Config.UseClientSideSpawning = true -- Client-side spawning (better for mods)
Config.FuelResource = 'LegacyFuel' -- Fuel system integration
Config.NotificationProvider = 'qb' -- 'ox' or 'qb'
Config.TextUIProvider = 'standalone' -- 'ox', 'qb', or 'standalone'
Config.TargetResource = 'qb-target' -- 'qb-target' or 'ox_target'Garage States
Config.GarageStates = {
out = 0, -- Vehicle is spawned
in_garage = 1, -- Vehicle is stored
impounded = 2, -- Vehicle is impounded
}Garage Types
Config.GarageTypes = {
car = 0, -- Cars, motorcycles, etc.
boat = 1, -- Boats
plane = 2, -- Planes
helicopter = 3, -- Helicopters
}Admin Commands
| Command | Description | Permission |
|---|---|---|
/creategarage | Create a new garage | Admin |
/managegarage | Edit existing garage settings | Admin |
/deletegarage | Delete a garage | Admin |
/managejobgarages | Manage job garages | Admin |
/impound | Impound a vehicle | Configured Jobs |
Client Exports
CreateTempGarage
Create a temporary garage (useful for scripts/events)
exports['sg-garages']:CreateTempGarage({
gid = 'temp_garage_1',
name = 'Temporary Garage',
polyzone = {
points = {
vector3(x, y, z),
vector3(x, y, z),
vector3(x, y, z),
},
minZ = z - 1.0,
maxZ = z + 4.0
},
spawns = {
vector4(x, y, z, heading),
},
setting = {
type = 'car',
enableblip = false,
blipname = 'Temp Garage',
blipnumber = 357,
blipcolor = 3,
blipscale = 0.6,
}
})RemoveTempGarage
Remove a temporary garage
exports['sg-garages']:RemoveTempGarage('temp_garage_1')HasTempGarage
Check if a temporary garage exists
local exists = exports['sg-garages']:HasTempGarage('temp_garage_1')Impound System
Features
- Authorization Levels - Configure which jobs can impound/release vehicles
- Self-Release Timer - Set time before owner can self-release
- Permanent Impounds - Require authorized personnel to release
- NPC Vehicle Impounding - Impound and remove NPC vehicles from scene
- Impound Tracking - Track who impounded, when, and why
Configuration
Config.AllowedJobsForImpounding = {
["police"] = 0, -- Job name and minimum grade
}
Config.ImpoundAlphaJob = "police" -- Job that can release any impound
Config.ReminderNotification = true -- Remind to charge release feeUsage
- Use
/impoundcommand while in a vehicle or near one - Fill in reason and release options
- Vehicle is impounded and owner is notified
- Owner or authorized jobs can release from impound lot
Job Garages
Features
- Rank Restrictions - Limit vehicles by job rank
- Vehicle Customization - Pre-configure extras, performance, colors, liveries
- Outstanding Fines - Charge players for not returning vehicles
- Prop-Based Access - Use props (parking meters) for interaction
- Color Options - Choose from preset colors when spawning
Setup
- Use
/managejobgaragescommand - Create new job garage with prop location
- Add spawn points for vehicles
- Add vehicles with rank restrictions and customization
- Players with the job can access via prop
Physical Garage Preview
View your favorite vehicles in a 3D space with the ability to drive them out directly from the preview.
How It Works
- Open garage UI
- Click "Go to Garage" button
- Teleports to physical garage with your vehicles displayed
- Walk around and view your collection
- Uses routing buckets for player isolation
Vehicle Display Logic
- Favorites First - Favorite vehicles are prioritized and displayed first
- Spawn Point Limit - Only as many vehicles as configured spawn points will be shown
- Example: If you have 8 spawn points configured, up to 8 vehicles will display
Drive-Out Feature
- Enter any preview vehicle by walking up to it
- TextUI changes to
[E] Obtain Keys and Drive Out - Press E to receive keys, exit preview, and spawn the vehicle at the actual garage location with a smooth fade-in
Configuration
Config.PhysicallGarageFeatures = true -- Enable physical garage preview
Config.PhysicalGarageSpawnPoint = vector4(x, y, z, heading) -- Player spawn location
Config.PersonalGarageVehicles = { -- Vehicle display spawn points (max vehicles shown = number of points)
vector4(x, y, z, heading),
-- Add more spawn points as needed
}
Config.PersonalGarageRoutingBuckets = { -- Routing buckets for player isolation
{1, 2, 3, 4, 5, 6, 7, 8, 9, 10},
}Troubleshooting
Vehicles not spawning with mods
Set Config.UseClientSideSpawning = true
Garages not loading
- - Check database connection
- - Verify SQL tables were created
- - Ensure
Config.CopyFromSQL = truewas set on first run - - Check server console for errors
Fuel not saving
- - Verify
Config.FuelResourcematches your fuel system - - Ensure fuel resource is started before sg-garages
Vehicle keys not working
- - Ensure vehicle keys resource is started
- - Check that resource name matches (
qb-vehiclekeysorqbx_vehiclekeys)
Framework not detected
- - Set
Config.Frameworkexplicitly instead of 'auto' - - Ensure framework is started before sg-garages
Preview vehicles not showing all favorites
- - The number of vehicles shown is limited by
Config.PersonalGarageVehiclesspawn points - - Add more spawn points to display more vehicles