SleepyCode
Home
AboutBlogSubscriptionDocs
Cart0
SleepyCode
Cart0
  • πŸ’£Documentation

Scripts

  • Multicharacter
  • DevTool
  • Fishing
  • πŸ—ƒοΈGarages V2
    • What's New
    • Installation
    • Config File
    • Features
    • Exports and Hooks
    • Framework and Integrations
    • Commands
    • Troubleshooting
  • 🚌Bus Job
  • πŸš—Vehicle Shop V1
  • πŸ—ƒοΈGarages V1
  • 🍁Selldrugs
  • πŸŽ…Advent Calendar
  1. Docs
  2. /Garages V2
  3. /Exports and Hooks

Garages V2

Exports and Hooks

Client exports, server exports, and custom hook functions available in Garages V2.

On this page4 sections
  • Client exports
  • Server exports
  • Custom hooks
  • Hook example

Client exportsLink copied

All exports use the sc_garages resource name.

Zone state

inGarageZone

Returns whether the player is inside a garage zone.

Lua
local inside = exports.sc_garages:inGarageZone()

getCurrentZoneType

Returns the active zone type.

Lua
local zoneType = exports.sc_garages:getCurrentZoneType()-- Returns: "Vehicle" | "Planes" | "Boat" | nil

getCurrentZoneName

Returns the active garage zone name.

Lua
local zoneName = exports.sc_garages:getCurrentZoneName()

getCurrentImpoundName

Returns the active impound name in the current UI context.

Lua
local impoundName = exports.sc_garages:getCurrentImpoundName()

Vehicle data

getVehiclesData

Returns the last vehicle list used by the UI.

Lua
local vehicles = exports.sc_garages:getVehiclesData()

UI control

openGarage

Lua
exports.sc_garages:openGarage()

openImpound

Lua
exports.sc_garages:openImpound()

openPlaneGarage

Lua
exports.sc_garages:openPlaneGarage()

openBoatGarage

Lua
exports.sc_garages:openBoatGarage()

closeGarageUi

Lua
exports.sc_garages:closeGarageUi()

Server exportsLink copied

Vehicle CRUD

vehicleExists

Lua
local exists = exports.sc_garages:vehicleExists(plate)

getVehicle

Lua
local row = exports.sc_garages:getVehicle(plate)

getPlayerVehicles

Lua
local vehicles = exports.sc_garages:getPlayerVehicles(ownerIdentifier)

addVehicle

Lua
local ok, plateOrReason = exports.sc_garages:addVehicle(ownerIdentifier, plate, model, vtype, garage, props)

removeVehicle

Lua
local ok = exports.sc_garages:removeVehicle(plate)

Plate and transfer

changePlate

Lua
local ok, result = exports.sc_garages:changePlate(ownerIdentifier, oldPlate, newPlate)

transferVehicle

Lua
local ok = exports.sc_garages:transferVehicle(plate, newOwnerIdentifier)

Storage state

storeVehicle

Lua
local ok = exports.sc_garages:storeVehicle(plate, location)

unstoreVehicle

Lua
local ok = exports.sc_garages:unstoreVehicle(plate, location)

updateVehicleProps

Lua
local ok = exports.sc_garages:updateVehicleProps(plate, props, vtype, location)

Insurance

setInsurance

Lua
local ok = exports.sc_garages:setInsurance(ownerIdentifier, plate, insuranceData)

clearInsurance

Lua
local ok = exports.sc_garages:clearInsurance(ownerIdentifier, plate)

Co-owner

setCoOwner

Lua
local ok = exports.sc_garages:setCoOwner(ownerIdentifier, plate, coOwnerIdentifier)

clearCoOwner

Lua
local ok = exports.sc_garages:clearCoOwner(ownerIdentifier, plate)

History

logVehicleHistory

Lua
exports.sc_garages:logVehicleHistory(ownerIdentifier, plate, action, details, actorId, actorName, location)

getVehicleHistory

Lua
local history = exports.sc_garages:getVehicleHistory(plate, limit)

getOwnerHistory

Lua
local history = exports.sc_garages:getOwnerHistory(ownerIdentifier, limit)

Police tow

towVehicle

Lua
local result = exports.sc_garages:towVehicle(plate, impoundName, holdHours, actorSrc, reason)-- Returns: { success, reason, holdUntil }

setVehicleHold

Lua
local result = exports.sc_garages:setVehicleHold(plate, holdHours)-- Returns: { success, holdUntil }

releaseVehicleHold

Lua
local result = exports.sc_garages:releaseVehicleHold(plate)-- Returns: { success }

getVehicleHold

Lua
local hold = exports.sc_garages:getVehicleHold(plate)-- Returns: { plate, holdUntil, isActive, remaining } | nil

Custom hooksLink copied

Custom hook functions are available in client/functions.lua.

Available hooks

Functions.onGarageEnter(zoneName, zoneType)

Called when a player enters a garage zone.

Functions.onGarageExit(zoneName)

Called when a player leaves a garage zone.

Functions.canStoreVehicle(vehicle, plate, zoneType)

Called before vehicle storage.

Lua
function Functions.canStoreVehicle(vehicle, plate, zoneType)    return true, nilend

Functions.onVehicleStored(plate, zoneType)

Called after a vehicle is stored.

Functions.onVehicleSpawned(plate, spawnCoords)

Called after a vehicle spawns.

Functions.onShowroomEnter(showroomName)

Called when a player enters a showroom.

Functions.onShowroomExit(showroomName)

Called when a player exits a showroom.

Functions.canOpenImpound(impoundName, playerJob)

Called before opening an impound UI.

Lua
function Functions.canOpenImpound(impoundName, playerJob)    return true, nilend

Functions.onVehicleReleased(plate, fee)

Called after impound release.

Hook exampleLink copied

Restrict storage when fuel is too low:

Lua
function Functions.canStoreVehicle(vehicle, plate, zoneType)    local fuel = GetVehicleFuelLevel(vehicle)    if fuel < 10 then        return false, "Vehicle needs at least 10% fuel to store"    end    return true, nilend

Log a custom message when a vehicle spawns:

Lua
function Functions.onVehicleSpawned(plate, spawnCoords)    print(("Vehicle %s spawned at %.1f, %.1f, %.1f"):format(        plate,        spawnCoords.x,        spawnCoords.y,        spawnCoords.z    ))end
← PreviousFeaturesGarages V2Next β†’Framework and IntegrationsGarages V2

On this page

  • Client exports
  • Server exports
  • Custom hooks
  • Hook example
↑ Back to top
Ready when you are

Put your server on something that holds up

150+ servers run our resources - ESX, QBCore and standalone. Once the payment clears, the package is waiting in Keymaster.

Browse the catalogueAsk on Discord β†—
  • Delivered instantly
  • Support with no expiry
  • 100+ reviews
  • Payment via Tebex

SleepyCode

FiveM Scripts

Checkout is run by Tebex Limited- they handle payment, invoicing and refunds. Β© 2026

Community

  • Discord
  • YouTube
  • X (Twitter)

Navigation

  • Home
  • All Scripts
  • ESX Scripts
  • QBCore Scripts
  • Free Scripts
  • About
  • Blog
  • Documentation
  • Support

Legal

  • Privacy Policy
  • Tebex Privacy Policy
  • Terms of Service
  • Impressum

Β© 2026 SleepyCode. Not affiliated with Rockstar Games or Take-Two Interactive.

Powered byTebex