Integrations
msk_garage is built to slot into an existing server. Every integration below is
optional and auto-detected (the script checks GetResourceState), so you
only enable what you actually run.
Key holders and faction vehicles have their own page: see Job vehicles.
AdvancedParking
AdvancedParking makes spawned vehicles persistent — it saves any vehicle a player interacts with and respawns it when a player gets close.
There is no Config.AdvancedParking setting anymore. The integration is enabled
automatically whenever the AdvancedParking resource is running
(Config.UsesAdvancedParking() in config/static.lua). Just ensure it before
msk_garage and you're done.
When AdvancedParking is running:
- Park-in removes the stored vehicle through AdvancedParking
(
DeleteVehicleUsingData) instead of a plainDeleteEntity, so it is taken out of AdvancedParking's table and does not respawn. - Impound park-out purges the old world copy from AdvancedParking's table
(
keepInWorld = false) before the fresh vehicle spawns. Without this step AdvancedParking would simply respawn the old car, leaving two vehicles.
Impound lock
Up to v5.4.0 the lock read AdvancedParking's vehicles_parking table directly. It
now asks AdvancedParking through its own exports, and
Config.AdvancedParkingTable / Config.AdvancedParkingPlateColumn are gone.
By default msk_garage clears the vehicle out of AdvancedParking itself and hands it
out right away. If you'd rather have the car leave the map first, enable
Settings → Impounds → "Lock impound while AdvancedParking holds the vehicle"
(Config.blockImpoundWhileAdvancedParked, off by default).
With the lock on:
- A plate that AdvancedParking still has a position for cannot be fetched from the impound. It only becomes available once the car is really gone (despawn, cleanup, or a manual delete).
- Affected vehicles show up greyed out in the impound UI with a "still in the world" label, and the park-out is refused server-side before the fee is charged — nobody pays for a blocked vehicle.
- Plates are matched space-insensitively, so a padded database plate and a trimmed AdvancedParking plate still find each other.
The check runs through AdvancedParking's own serverside exports
(GetVehiclePosition / GetVehiclePositions), the same ones the impound list uses
for the tracking waypoint, so there is no table or column to configure. If your
build does not expose them, the lock disables itself after a single console warning
instead of erroring on every request.
VehicleDeformation
Visual body damage (the actual dents, not just the health value) is not part of standard vehicle properties. To persist it, install VehicleDeformation.
- On park-in the script reads the deformation
(
GetVehicleDeformation) and stores it in thedeformationscolumn. - On park-out it reapplies it (
SetVehicleDeformation) once the client owns the entity.
No configuration is needed — the integration activates automatically when the
VehicleDeformation resource is started. Without it, mechanical condition
(engine/body/tank health, dirt) is still preserved through the vehicle
properties; only the visual dents are skipped.
The deformation offsets are vector3 values that don't survive JSON storage
intact, so the script flattens them to plain numbers on save and rebuilds real
vector3s on load. This is handled internally — you don't have to do anything.
Vehicle Keys
Key holders (players who own a key but not the vehicle itself) can park the vehicle in and out.
Config.VehicleKeys = {
enable = true,
script = 'msk_vehiclekeys', -- msk_vehiclekeys | VehicleKeyChain | vehicles_keys
}
Config.parkoutWithKey = true -- key holders may also retrieve from the impound
Supported out of the box (bridges live in server/keys/). The script is a
dropdown in the Admin Dashboard (Settings tab), populated
from AdminPerms.VEHICLEKEY_SCRIPTS:
Config.VehicleKeys.script | Resource |
|---|---|
msk_vehiclekeys | MSK VehicleKeys |
VehicleKeyChain | Vehicle Key Chain |
vehicles_keys | Jaksam Vehicle Keys |
Drop a new adapter file into server/keys/ that returns the keys for a player,
add its name to AdminPerms.VEHICLEKEY_SCRIPTS in shared/admin_perms.lua (so it
shows up in the dropdown), then select it in the dashboard. Only the three
adapters above are officially supported.
Fuel
Fuel is read/written through adapter functions in config/static.lua, so any
fuel script works. msk_fuel is auto-detected: when it runs, fuel is read and
written as exact liters via its exports and the UI shows the real tank volume
(e.g. 50 / 65 L); otherwise the vehicle state bag is used (compatible with
ox_fuel and similar) and the UI shows a percentage.
Config.UsesMskFuel = function()
return GetResourceState('msk_fuel') == 'started'
end
Config.SetFuel = function(vehicle, fuel)
if Config.UsesMskFuel() then
exports.msk_fuel:SetVehicleFuel(vehicle, fuel)
return
end
Entity(vehicle).state.fuel = fuel
end
Config.GetFuel = function(vehicle)
if Config.UsesMskFuel() then
return exports.msk_fuel:GetVehicleFuel(vehicle)
end
return Entity(vehicle).state.fuel
end
Replace the non-msk_fuel branches with your fuel resource's exports if needed
(e.g. exports.LegacyFuel:SetFuel(vehicle, fuel)).
For stored vehicles (the park-out / impound list, where no live entity
exists) the X / Y L denominator comes from msk_fuel's per-model override, or
falls back to Config.FuelTankDefaultVolume (default 65.0 L).
Target & TextUI
Config.TargetSystem = {
enable = true,
script = 'ox_target', -- selectable in the dashboard; adapters in client/target.lua
}
Config.defaultTextUI = true -- true = msk_core TextUI, false = your Config.openTextUI/closeTextUI
Config.openTextUI = function(coloredText, uncoloredText)
MSK.TextUI.Show('E', coloredText)
end
Config.closeTextUI = function()
MSK.TextUI.Close()
end
Config.TargetSystem— when enabled, interaction runs through the target script (defaultox_target). The script is a dropdown in the Admin Dashboard, populated fromAdminPerms.TARGET_SCRIPTS(shared/admin_perms.lua). Add adapters forqb-target,qtarget, … inclient/target.luaand list them there.Config.defaultTextUI—trueuses the built-inmsk_coreTextUI;falseroutes prompts through your ownConfig.openTextUI/Config.closeTextUIinconfig/static.lua.
Custom garages from other scripts
Other resources can open a fully custom garage/impound for a player. The definition must be registered server-side first (so it can't be forged), then the client opens the UI. See the full flow in Server Exports.