RX Garages Installation

RX Garages is a garage system for FiveM: public garages for cars, boats, and aircraft, private garages players buy and style, job garages, and impound lots. Vehicles that are out stay where they were left through a restart, and the server spawns and tracks every one of them.

The menus, forms, and key hints use the RX Interact look. That look is built into RX Garages, so it is the same on every server, with or without rx_interact installed.

Requirements

RequirementWhy it is needed
ESX, QBCore, or QboxRX Garages works on your framework’s own vehicle table (owned_vehicles or player_vehicles), so phones, mechanics, and other scripts see the same vehicles.
oxmysqlThe database connection.
rx_coreRipex’s core library, used here for the framework bridge. It comes in the RX Garages download.

These are detected automatically and are not required: a target or interaction script, a vehicle key script, and a fuel script. See Integrations.

1. Place the resources

Extract rx_garages and rx_core into your server’s resources directory. If your server already runs rx_core for another Ripex resource, keep the newer of the two copies.

2. Remove other garage scripts

Take any other garage script out of your server, such as qb-garages, qbx_garages, or esx_garage. Two scripts writing the same vehicle rows work against each other.

The same applies to a police job’s own impound. qb-policejob’s depot and impound menu writes the vehicle state itself, without the RX Garages fee and lot. Have officers use /impound instead, or point that menu at impoundVehicle.

3. Add it to server.cfg

Start it after your framework and oxmysql:

server.cfg
ensure oxmysql
ensure qb-core   # or es_extended / qbx_core

ensure rx_core
ensure rx_garages

4. Start the server

The database is prepared on the first start. RX Garages creates its own tables and adds its columns to your framework’s vehicle table:

TableWhat it holds
rx_private_garagesPrivate garages and their owners
rx_private_itemsStyles bought for each private garage
rx_private_membersPartners of each private garage
rx_garage_locationsPlaces created or moved with the in-game editor
rx_garage_logsTransfers, impounds, and purchases

Players keep the vehicles they already own, because RX Garages uses the same table. install.sql contains the same changes, for servers that prefer to run them by hand or whose database user may not alter tables.

5. Give admins the editor

The in-game editor and the coordinate helpers are behind one ACE:

server.cfg
add_ace group.admin command.rxgarages allow
CommandWhat it does
/rxgarages:adminOpens the in-game editor. See Garages & Editor.
/rxgarages:coordsCopies where you stand as a vector4. Inside an interior it also gives the point in the interior’s own frame.
/rxgarages:visit <interior>Takes you inside an interior to set its points. Run it again to come back.
rxgarages:exportWrites everything set in game into the config files. Runs from the server console or by an admin.

Player commands

CommandWhoWhat it does
/impoundJobs in Config.Impound.JobsOpens the impound form for the nearest vehicle: reason, fee, and lot.

Everything else is done at the garages themselves: the prompt at the garage point, and the key hint inside the parking zone.

Integrations

SettingDetected automatically
PromptsConfig.Interact = 'auto'rx_interact, then ox_target, then qb-target, otherwise RX Garages’ own key hints
Vehicle keysConfig.Keys = 'auto'qbx_vehiclekeys, qb-vehiclekeys, wasabi_carlock, qs-vehiclekeys, MrNewbVehicleKeys, Renewed-Vehiclekeys, ak47, cd_garage, okokVehicleKeys, jaksam
FuelConfig.Fuel = 'auto'ox_fuel, cdn-fuel, LegacyFuel, ps-fuel, lj-fuel, qs-fuelstations, okokGasStation, Renewed-Fuel, lc_fuel, and more
NotificationsConfig.Notify = 'auto'RX Interact’s when it runs, otherwise the framework’s

Each one can also be set by name; see Configuration. The key and vehicle bridges live in server/bridge/keys.lua and client/bridge/vehicle.lua, which stay open to edit.

Vehicle cleanup scripts

If a script on your server deletes empty vehicles every few minutes, have it skip the ones RX Garages keeps in the world. They carry a state bag:

Lua
if not Entity(vehicle).state.rxgPersistent then
    DeleteEntity(vehicle)
end

A vehicle deleted anyway goes to the impound, like a towed car. It is never lost or duplicated.

For other scripts

Lua
-- server
exports.rx_garages:impoundVehicle(entity, fee, reason, lotId)
exports.rx_garages:isVehicleOut(plate)
exports.rx_garages:getVehicleEntity(plate)

-- client events
AddEventHandler('rx_garages:vehicleOut', function(vehicle, plate) end)
AddEventHandler('rx_garages:enteredPrivate', function(garageId) end)
AddEventHandler('rx_garages:leftPrivate', function(garageId) end)

-- open an officer's impound form (checked again on the server)
TriggerEvent('rx_garages:client:impoundMenu')

How vehicles are kept right

  • The server spawns every vehicle and keeps track of it. No client reports where a vehicle is or that it was destroyed, so no event sent from a client can lose, copy, or free a vehicle.
  • Every change to a vehicle’s state is a single database update that only succeeds from the state it must be in, so two requests racing for the same vehicle cannot both win.
  • Money is taken before an action and given back if it fails.
  • Prices, places, and plates come from the config and the server’s own view of the world, never from the client.

Next: Configuration and Garages & Editor.