Client Exports
Use these exports to interact with the garage system from other client-side scripts.
General Exports
GetPlayerData
Returns the current player's cached data.
local PlayerData = exports['kartik-garages']:GetPlayerData()getVehicleDisplayName
Returns the display name of a vehicle based on its hash.
local name = exports['kartik-garages']:getVehicleDisplayName(vehicleHash)isPlayerPolice
Returns whether the player is currently on duty as police.
local isPolice = exports['kartik-garages']:isPlayerPolice()Garage UI & Interactions
openGarageByGarageId
Opens the garage menu for a specific garage ID programmatically.
--- @param garageId string The unique identifier of the garage.
--- @param spawnCoords vector4 (optional) The coordinates where the vehicle should spawn.
exports['kartik-garages']:openGarageByGarageId(garageId, spawnCoords)Example:
local garageId = "pdm_main"
local spawnCoords = vector4(215.3, -810.1, 30.7, 90.0)
exports['kartik-garages']:openGarageByGarageId(garageId, spawnCoords)parkVehicleByGarageId
Parks the player's current vehicle into a specific garage ID. The player must be inside the vehicle.
--- @param garageId string The unique identifier of the garage.
exports['kartik-garages']:parkVehicleByGarageId(garageId)Example:
local garageId = "pdm_main"
exports['kartik-garages']:parkVehicleByGarageId(garageId)Utility Exports
usePlate
Opens the UI to change the vehicle's plate (requires the plate item unless called as an admin).
exports['kartik-garages']:usePlate()detectCore
Helper to detect if a specific resource/core is running.
local isStarted = exports['kartik-garages']:detectCore("qb-core")showKeybindsMenu
Shows the keybinds help NUI.
exports['kartik-garages']:showKeybindsMenu(data)hideKeybindsMenu
Hides the keybinds help NUI.
exports['kartik-garages']:hideKeybindsMenu()