🚗🔒 Garages built to stop dupes
Every car goes out once and comes back once. Public, private, job, gang and impound garages for cars, boats and aircraft, with animated interiors, shared vehicles and an in-game builder. The server spawns and deletes every vehicle.
Why it hits different
- 🔐 Dupe-proof by design: only one take-out can win. If a spawn fails, the state rolls back and the fee is refunded.
- 🏢 Walk in, drive out: GTA Online interiors with your cars parked in their slots.
- 🌍 Fits your database: player_vehicles, owned_vehicles or its own table, picked with one setting.
What you get
rd_garage v1.0 with English and Spanish texts and auto-installed SQL.- Six sample garages (coordinates are samples), a catalog of vanilla interiors and an editable storage adapter.
Features
Garages
- Five garage types with distance, ownership, vehicle-type and capacity checks.
- Optional public network: take a vehicle out at any public garage of its type.
- Free job and gang fleets, plus private garages for housing via
GrantGarageAccess.
Interiors
- Walk or drive into a vanilla GTA Online (IPL) interior behind a full-screen transition, pick a car, press E and drive out.
- A private routing bucket per player, no peds inside, and a server watchdog that returns anyone who left unexpectedly (death, teleport) to the main world.
Protection
- One operation at a time per character and per plate, plus a per-player rate limit (8 requests per 6 s by default).
- Take-out is a compare-and-swap (
UPDATE … WHERE state = 1), refused if a live vehicle with that plate already exists. - On store, plate, model, health and owner are read from the server-side vehicle; the client only sends filtered cosmetics.
Impound and sharing
- Per-vehicle impound fee (500 when none is set) and
/impound for police, sheriff and mechanic. - Vehicles missing from the world for 12 hours go to the impound; recovery on restart is off until you enable it.
- Owners share a vehicle with up to three characters without giving up ownership. Shares stop working if the car changes hands.
Builder and info
/garagebuilder (admins) creates garages and saves them to SQL; /garageexport prints a block for config.lua.- Info cards per garage, database audit and optional Discord log. Optional: stat holograms over interior cars with rd_holo, sold separately.
How it works
- Drive into the garage marker (or target) to store your car; on foot, open the menu to take one out.
- The server locks character and plate, flips the state and spawns the vehicle.
- Saved properties and fuel are applied; keys are handed over through rd_bridge.
Configuration
Config.VehicleStorage: auto, qbcore (player_vehicles), esx (owned_vehicles) or own (rd_garage_vehicles).- Interaction (marker or target), blips, store and take-out rules, capacity, key hooks (
Config.Keys.serverEvent for your own key script), impound, sharing, fleet, interior, builder and audit. - The Discord webhook goes in server.cfg (
set rd_garage_webhook).
Requirements
- Required: ox_lib, oxmysql and rd_bridge (start rd_bridge first; it needs the version with Info and Holo support).
- Optional: ox_target or qb-target; a key script and a fuel script supported by rd_bridge; rd_holo, sold separately.
- No items. It does not alter player_vehicles or owned_vehicles.
Install in 5 steps
- 1. Copy
rd_garage into resources/ and make sure rd_bridge, ox_lib and oxmysql start first. - 2. The database installs itself (
Config.AutoInstallSQL = true), or import sql/install.sql. - 3. Add
ensure rd_garage after rd_bridge and disable your old garage script. Never run two garage systems on the same table. - 4. Edit config.lua:
Config.VehicleStorage, your garages and rules. - 5. Restart and read the console: it prints the storage in use and any configuration error.
Compatibility
QBCore · Qbox · ESX · standalone through rd_bridge (adapters reviewed against each resource's official documentation). Only standard player_vehicles / owned_vehicles columns are written.
Protected with Cfx.re Asset Escrow; config.lua, shared/interiors.lua, server/vehicles.lua, locales, SQL and the UI files stay editable.
First release — report any issue and we fix it.
Exports & events
- Server:
CanUseVehicle, GetOwnedVehicles, GetVehicleRecord, IsVehicleOut, ImpoundVehicle, ShareVehicle / UnshareVehicle, GrantGarageAccess / RevokeGarageAccess, AddOwnedVehicle (own storage only), GetGarages / RefreshGarages, plus lock and audit helpers (AcquireVehicleOpLock, ReleaseVehicleOpLock, PurgeVehicleStateByPlate, AuditVehicleOperation). - Client:
IsInsideGarageInterior, GetGarageInteriorContext, GetGarages. - Server event
rd_garage:vehicleSpawned (src, plate, netId, garageId). - Commands:
/garagebuilder, /garageexport, /impound [fee] [reason], /garageunstuck.
FAQ
No garage shows up.
Check the console, that the SQL is installed and that rd_bridge starts first.
My vehicles don't come out.
Check Config.PublicNetwork and that the garage id matches the garage column.
Can I migrate from my old garages?
Yes. Keep the same garage ids or update the garage column; the README has notes for qb-garages and esx_garage-style tables.
Has it run on a live server?
No: spawning, interiors and the builder have not run on a live server yet.
🇪🇸 En español
🚗🔒 Garajes hechos para frenar duplicados
Cada coche sale una vez y vuelve una vez. Garajes públicos, privados, de trabajo, de banda y depósito para coches, barcos y aeronaves, con interiores animados, vehículos compartidos y constructor en el juego. El servidor crea y borra cada vehículo.
Por qué marca la diferencia
- 🔐 Sin duplicados de serie: solo puede ganar una salida. Si el vehículo no aparece, se deshace el cambio y se devuelve la tarifa.
- 🏢 Entra andando, sal conduciendo: interiores de GTA Online con tus coches aparcados en sus plazas.
- 🌍 Se adapta a tu base de datos: player_vehicles, owned_vehicles o tabla propia, con un solo ajuste.
Qué incluye
rd_garage v1.0 con textos en español e inglés y SQL que se instala solo.- Seis garajes de ejemplo (coordenadas de muestra), catálogo de interiores vanilla y adaptador de almacenamiento editable.
Funciones
Garajes
- Cinco tipos de garaje con comprobación de distancia, propiedad, tipo de vehículo y capacidad.
- Red pública opcional: saca un vehículo en cualquier garaje público de su tipo.
- Flotas gratuitas de trabajo y banda, y garajes privados para viviendas con
GrantGarageAccess.
Interiores
- Entra a pie o conduciendo en un interior vanilla de GTA Online (IPL) tras una transición a pantalla completa, elige coche, pulsa E y sal conduciendo.
- Un routing bucket privado por jugador, sin peatones dentro, y un vigilante en el servidor que devuelve al mundo principal a quien sale de forma inesperada (muerte, teletransporte).
Protección
- Una operación a la vez por personaje y por matrícula, más un límite de peticiones por jugador (8 cada 6 s por defecto).
- Sacar es un compare-and-swap (
UPDATE … WHERE state = 1) y se rechaza si ya hay un vehículo con esa matrícula en el mundo. - Al guardar, matrícula, modelo, salud y dueño se leen del vehículo en el servidor; el cliente solo envía la estética, filtrada.
Depósito y vehículos compartidos
- Tarifa de depósito por vehículo (500 si no tiene otra) y
/impound para policía, sheriff y mecánicos. - Los vehículos que llevan 12 horas sin existir en el mundo pasan al depósito; la recuperación al reiniciar está desactivada hasta que la actives.
- El dueño comparte un vehículo con hasta tres personajes sin ceder la propiedad. Si el coche cambia de dueño, el acceso compartido deja de valer.
Constructor e información
/garagebuilder (admins) crea garajes y los guarda en SQL; /garageexport genera un bloque para config.lua.- Tarjetas informativas por garaje, auditoría en base de datos y registro opcional en Discord. Opcional: hologramas con estadísticas sobre los coches del interior con rd_holo, a la venta por separado.
Cómo funciona
- Entra con el coche en el marcador (o target) del garaje para guardarlo; a pie, abre el menú para sacar uno.
- El servidor bloquea personaje y matrícula, cambia el estado y crea el vehículo.
- Aplica las propiedades y el combustible guardados y entrega las llaves a través de rd_bridge.
Configuración
Config.VehicleStorage: auto, qbcore (player_vehicles), esx (owned_vehicles) u own (rd_garage_vehicles).- Interacción (marcador o target), blips, reglas de guardado y salida, capacidad, ganchos de llaves (
Config.Keys.serverEvent para tu propio script de llaves), depósito, vehículos compartidos, flotas, interior, constructor y auditoría. - El webhook de Discord va en server.cfg (
set rd_garage_webhook).
Requisitos
- Obligatorios: ox_lib, oxmysql y rd_bridge (arranca rd_bridge antes; necesita la versión con soporte de Info y Holo).
- Opcionales: ox_target o qb-target; un script de llaves y uno de combustible compatibles con rd_bridge; rd_holo, a la venta por separado.
- Sin ítems. No modifica player_vehicles ni owned_vehicles.
Instalación en 5 pasos
- 1. Copia
rd_garage a resources/ y asegúrate de que rd_bridge, ox_lib y oxmysql arrancan antes. - 2. La base de datos se instala sola (
Config.AutoInstallSQL = true), o importa sql/install.sql. - 3. Añade
ensure rd_garage después de rd_bridge y desactiva tu script de garajes anterior. Nunca uses dos sistemas de garajes sobre la misma tabla. - 4. Edita config.lua:
Config.VehicleStorage, tus garajes y las reglas. - 5. Reinicia y mira la consola: indica el almacenamiento en uso y cualquier error de configuración.
Compatibilidad
QBCore · Qbox · ESX · standalone mediante rd_bridge (adaptadores revisados contra la documentación oficial de cada recurso). Solo se escriben columnas estándar de player_vehicles / owned_vehicles.
Protegido con Cfx.re Asset Escrow; config.lua, shared/interiors.lua, server/vehicles.lua, locales, SQL y los archivos de la interfaz quedan editables.
Primera versión: si encuentras cualquier fallo, avísanos y lo corregimos.
Exports y eventos
- Servidor:
CanUseVehicle, GetOwnedVehicles, GetVehicleRecord, IsVehicleOut, ImpoundVehicle, ShareVehicle / UnshareVehicle, GrantGarageAccess / RevokeGarageAccess, AddOwnedVehicle (solo almacenamiento own), GetGarages / RefreshGarages, y utilidades de bloqueo y auditoría (AcquireVehicleOpLock, ReleaseVehicleOpLock, PurgeVehicleStateByPlate, AuditVehicleOperation). - Cliente:
IsInsideGarageInterior, GetGarageInteriorContext, GetGarages. - Evento de servidor
rd_garage:vehicleSpawned (src, plate, netId, garageId). - Comandos:
/garagebuilder, /garageexport, /impound [tarifa] [motivo], /garageunstuck.
Preguntas frecuentes
No aparece ningún garaje.
Revisa la consola, que el SQL esté instalado y que rd_bridge arranque antes.
Mis vehículos no salen.
Revisa Config.PublicNetwork y que el id del garaje coincida con la columna garage.
¿Puedo migrar desde mis garajes de antes?
Sí. Mantén los mismos ids de garaje o actualiza la columna garage; el README trae notas para qb-garages y tablas del estilo de esx_garage.
¿Se ha usado ya en un servidor en marcha?
Todavía no: la creación de vehículos, los interiores y el constructor aún no se han ejecutado en un servidor real.