Client
Client-side exports for ak47_garage.
GetGarages
Returns a list of all registered garages and their configuration settings.
local garages = exports['ak47_garage']:GetGarages()| Parameter | Type | Required | Description |
|---|---|---|---|
| None | N/A | No | Takes no parameters |
- Returns:
table- Array of garage objects with settings, fees, and types.
GetCurrentGarage
Returns information about the garage zone the player is currently inside.
local current = exports['ak47_garage']:GetCurrentGarage()| Parameter | Type | Required | Description |
|---|---|---|---|
| None | N/A | No | Takes no parameters |
- Returns:
table- Table containingname,garage, andanyGarage.
IsInsideGarage
Checks if the player is currently standing inside any garage polyzone.
local isInside = exports['ak47_garage']:IsInsideGarage()| Parameter | Type | Required | Description |
|---|---|---|---|
| None | N/A | No | Takes no parameters |
- Returns:
boolean-trueif inside a garage boundary,falseotherwise.
GetInsideGarageId
Retrieves the identifier of the garage zone the player is inside.
local gid = exports['ak47_garage']:GetInsideGarageId()| Parameter | Type | Required | Description |
|---|---|---|---|
| None | N/A | No | Takes no parameters |
- Returns:
string \| nil- Garage identifier if inside a zone,nilotherwise.
GetGarageData
Retrieves the internal configuration data for a specific garage ID.
local data = exports['ak47_garage']:GetGarageData(gid)| Parameter | Type | Required | Description |
|---|---|---|---|
gid |
string | Yes | Unique garage identifier |
- Returns:
table \| nil- Garage object ornilif not found.
OpenGarage
Opens the 3D showroom and NUI garage menu for a garage.
local success = exports['ak47_garage']:OpenGarage(gid)| Parameter | Type | Required | Description |
|---|---|---|---|
gid |
string | No | Optional garage ID. Defaults to current zone. |
- Returns:
boolean-trueif opened successfully,falseotherwise.
CloseGarage
Closes the garage menu UI and destroys preview showroom camera and vehicle.
local closed = exports['ak47_garage']:CloseGarage()| Parameter | Type | Required | Description |
|---|---|---|---|
| None | N/A | No | Takes no parameters |
- Returns:
boolean-trueif closed,falseotherwise.
IsGarageOpenUI
Checks if the garage NUI menu and showroom camera are currently open.
local isOpen = exports['ak47_garage']:IsGarageOpenUI()| Parameter | Type | Required | Description |
|---|---|---|---|
| None | N/A | No | Takes no parameters |
- Returns:
boolean-trueif UI is open,falseotherwise.
SpawnVehicle
Spawns a vehicle from the garage by license plate.
exports['ak47_garage']:SpawnVehicle(plate, targetGid)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
targetGid |
string | No | Optional garage ID. Defaults to current zone. |
- Returns:
void
ParkCurrentVehicle
Parks the vehicle the player is currently driving into the garage.
local success = exports['ak47_garage']:ParkCurrentVehicle(gid)| Parameter | Type | Required | Description |
|---|---|---|---|
gid |
string | No | Optional garage ID. Defaults to current zone. |
- Returns:
boolean-trueif initiated,falseotherwise.
StartTabletAnim
Plays the tablet animation and attaches tablet prop to player ped.
exports['ak47_garage']:StartTabletAnim()| Parameter | Type | Required | Description |
|---|---|---|---|
| None | N/A | No | Takes no parameters |
- Returns:
void
StopTabletAnim
Stops tablet animation and removes attached tablet prop from player ped.
exports['ak47_garage']:StopTabletAnim()| Parameter | Type | Required | Description |
|---|---|---|---|
| None | N/A | No | Takes no parameters |
- Returns:
void
PayRealFee
Deducts real parking fee if parking charges are enabled for garage.
local paid = exports['ak47_garage']:PayRealFee(gid, plate)| Parameter | Type | Required | Description |
|---|---|---|---|
gid |
string | Yes | Garage identifier |
plate |
string | Yes | Vehicle license plate |
- Returns:
boolean-trueif paid or free,falseif insufficient funds.
TakeVehiclePhoto
Spawns vehicle in photo studio, captures screenshot, and uploads to FiveManage.
exports['ak47_garage']:TakeVehiclePhoto(plate)| Parameter | Type | Required | Description |
|---|---|---|---|
plate |
string | Yes | Vehicle license plate |
- Returns:
void
GetPhotoPreset
Returns camera preset configuration for a vehicle model based on dimensions.
local presetName, presetConfig = exports['ak47_garage']:GetPhotoPreset(modelHash)| Parameter | Type | Required | Description |
|---|---|---|---|
modelHash |
number | string | Yes | Vehicle model hash or name |
- Returns:
string,table- Preset name and camera config table (CamCoords,CamRotation,Fov).
GetVehicleType
Resolves the garage classification category for a vehicle model.
local vType = exports['ak47_garage']:GetVehicleType(model)| Parameter | Type | Required | Description |
|---|---|---|---|
model |
number | string | Yes | Vehicle model hash or name |
- Returns:
string- Vehicle category (automobile,bike,boat,heli,plane,submarine,trailer).
IsVehicleCompatible
Checks if a vehicle model is allowed in a specific garage category.
local isCompatible = exports['ak47_garage']:IsVehicleCompatible(model, garageType)| Parameter | Type | Required | Description |
|---|---|---|---|
model |
number | string | Yes | Vehicle model hash or name |
garageType |
string | Yes | Target garage type (car, boat, heli, plane) |
- Returns:
boolean-trueif compatible,falseotherwise.
GetVehicleRealStats
Calculates performance metrics, handling physics, and rarity for a vehicle model.
local stats = exports['ak47_garage']:GetVehicleRealStats(modelHash, vehicleEntity)| Parameter | Type | Required | Description |
|---|---|---|---|
modelHash |
number | string | Yes | Vehicle model hash or name |
vehicleEntity |
number | No | Optional active vehicle entity handle |
- Returns:
table- Statistics object (topSpeed,acceleration,handling,braking,driveType,power,weight,rarity).
GetVehicleRarity
Calculates vehicle rarity tier based on performance factors.
local tier = exports['ak47_garage']:GetVehicleRarity(maxSpeed, accel, handling, braking)| Parameter | Type | Required | Description |
|---|---|---|---|
maxSpeed |
number | Yes | Top speed in km/h |
accel |
number | Yes | Acceleration value |
handling |
number | Yes | Handling rating (0-100) |
braking |
number | Yes | Braking rating (0-100) |
- Returns:
string- Rarity tier (COMMON,UNCOMMON,RARE,EPIC).