Server-side exports for ak47_garage.
Retrieves all owned vehicles for a player server ID with status and fees.
local vehicles = exports['ak47_garage']:GetPlayerVehicles(source)| Parameter | Type | Required | Description |
|---|---|---|---|
source |
number | Yes | Player server ID |
table - Array of owned vehicle objects.Queries database and retrieves raw vehicle record by license plate.
local vehicle = exports['ak47_garage']:GetVehicleByPlate(plate)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
table \| nil - Vehicle database row or nil.Checks if a vehicle is currently active in the game world.
local isActive, entity, coords = exports['ak47_garage']:IsVehicleOut(plate)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
boolean, number \| nil, vector3 \| nil - Active state, handle, and coordinates.Retrieves coordinates and entity handle for an active or real-parked vehicle.
local coords, entity = exports['ak47_garage']:GetVehicleLocation(plate)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
vector3 \| nil, number \| nil - Vehicle coordinates and entity handle.Transfers a vehicle to another garage location and deducts transfer fee.
local success = exports['ak47_garage']:TransferVehicle(source, plate, gid)| Parameter | Type | Required | Description |
|---|---|---|---|
source |
number | Yes | Player server ID |
plate |
string | Yes | Vehicle license plate |
gid |
string | Yes | Destination garage identifier |
boolean - true if transfer succeeded, false otherwise.Transfers permanent ownership of a vehicle to another player.
local success, message = exports['ak47_garage']:TransferOwnership(source, targetSource, plate)| Parameter | Type | Required | Description |
|---|---|---|---|
source |
number | Yes | Sender player server ID |
targetSource |
number | Yes | Receiver player server ID |
plate |
string | Yes | Vehicle license plate |
boolean, string - Success flag and status message.Deducts accumulated time-based parking fees from owner bank account.
local success = exports['ak47_garage']:PayGarageFee(source, plate)| Parameter | Type | Required | Description |
|---|---|---|---|
source |
number | Yes | Player server ID |
plate |
string | Yes | Vehicle license plate |
boolean - true if paid or free, false if insufficient funds.Updates vehicle stored state in database and cleans up entities and caches.
local success = exports['ak47_garage']:SetVehicleStoredState(plate, state, garageId, poundFee)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
state |
number | Yes | 0 = Out, 1 = Stored, 2 = Impounded |
garageId |
string | No | Optional destination garage identifier |
poundFee |
number | No | Optional impound fee amount |
boolean - true if updated successfully.Programmatically stores a vehicle into a garage and updates database modifications.
local success = exports['ak47_garage']:ParkVehicleServer(plate, garageId, vehicleProps)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
garageId |
string | Yes | Destination garage identifier |
vehicleProps |
table | No | Optional vehicle properties table to save |
boolean - true on success.Programmatically impounds a vehicle into an impound lot.
local success = exports['ak47_garage']:ImpoundVehicle(plate, impoundGid, fee)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
impoundGid |
string | No | Impound garage ID. Defaults to "Impound" |
fee |
number | No | Impound fee amount |
boolean - true on success.Returns complete internal table of all registered garages.
local garages = exports['ak47_garage']:GetAllGarages()| Parameter | Type | Required | Description |
|---|---|---|---|
| None | N/A | No | Takes no parameters |
table - Garages table keyed by garage identifier.Retrieves configuration and runtime settings for a garage ID.
local garage = exports['ak47_garage']:GetGarageById(gid)| Parameter | Type | Required | Description |
|---|---|---|---|
gid |
string | Yes | Garage identifier |
table \| nil - Garage object or nil if not found.Retrieves cached performance statistics for a vehicle model.
local stats = exports['ak47_garage']:GetVehicleModelStats(modelKey)| Parameter | Type | Required | Description |
|---|---|---|---|
modelKey |
string | number | Yes | Vehicle model name or hash |
table \| nil - Vehicle performance stats table or nil.Retrieves active vehicle rescue operations currently queued on server.
local rescues = exports['ak47_garage']:GetPendingRescues()| Parameter | Type | Required | Description |
|---|---|---|---|
| None | N/A | No | Takes no parameters |
table - Pending rescues table keyed by plate.Cancels and clears an active rescue operation for a vehicle plate.
exports['ak47_garage']:ClearRescueTimer(plate)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
voidSaves full vehicle state into persistent vehicles cache and database.
exports['ak47_garage']:SaveVehiclePersistence(plate, coords, mods, health, status, fuel, locked, owner, model)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
coords |
table | Yes | Position coordinates and heading {x, y, z, w} |
mods |
table | No | Vehicle modifications table |
health |
table | No | Engine, body, door, tire, and window health data |
status |
table | No | Extended status (engine, lights, radio, roof, dirt) |
fuel |
number | No | Fuel level percentage (0-100) |
locked |
number | No | Door lock state (1 = unlocked, 2 = locked) |
owner |
string | No | Player identifier (auto-detected if omitted) |
model |
number | string | No | Vehicle model hash or name |
voidRemoves vehicle from persistent cache and database table.
exports['ak47_garage']:RemoveVehiclePersistence(plate)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
voidRemoves persistent records and deletes physical vehicle entity from world.
exports['ak47_garage']:DeletePersistentVehicle(plate)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
voidImpounds a persistent vehicle and removes it from world persistence.
exports['ak47_garage']:ImpoundPersistentVehicle(plate, fee, reason)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
fee |
number | No | Impound fee amount |
reason |
string | No | Reason description |
voidChecks whether a vehicle is currently tracked in persistent vehicles cache.
local isPersistent = exports['ak47_garage']:IsVehiclePersistent(plate)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
boolean - true if tracked, false otherwise.Retrieves the entire persistent vehicles cache table.
local cache = exports['ak47_garage']:GetPersistentVehicles()| Parameter | Type | Required | Description |
|---|---|---|---|
| None | N/A | No | Takes no parameters |
table - Cache table keyed by vehicle plate.Clears RealParking dummy data and despawns visual dummy for a plate.
exports['ak47_garage']:ClearRealParkedVehicle(plate)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
voidClears all RealParked dummy vehicles inside a specific garage.
exports['ak47_garage']:ClearGarageRealParking(gid)| Parameter | Type | Required | Description |
|---|---|---|---|
gid |
string | Yes | Garage identifier |
voidUpdates internal tracking when vehicle plate is changed by external script.
local success = exports['ak47_garage']:VehiclePlateChanged(oldPlate, newPlate)| Parameter | Type | Required | Description |
|---|---|---|---|
oldPlate |
string | Yes | Previous vehicle license plate |
newPlate |
string | Yes | New vehicle license plate |
boolean - true if synchronized successfully, false otherwise.