> For the complete documentation index, see [llms.txt](https://docs.menanak47.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.menanak47.com/multi-framework/ak47_garage/exports/client.md).

# Client

### `GetGarages`

Returns a list of all registered garages and their basic settings.

```lua
local garages = exports['ak47_garage']:GetGarages()
```

#### Return Values

| Type    | Description                      |
| ------- | -------------------------------- |
| `table` | Array of garage summary objects: |

Each item in the array contains:

* `name` (`string`): Unique garage identifier / name.
* `fee` (`number`): Vehicle transfer fee for this garage.
* `type` (`string`): Garage category (`car`, `boat`, `heli`, `plane`).
* `isImpound` (`boolean`): Whether the garage acts as an impound lot.
* `realParking` (`boolean`): Whether physical parking dummies are enabled.
* `maxVehicle` (`number`): Maximum parking capacity if parking limits are active.
* `parkingFee` (`number`): Hourly parking fee rate.
* `maxParkingFee` (`number`): Maximum parking fee cap (-1 for unlimited).

#### Example

```lua
local garages = exports['ak47_garage']:GetGarages()
for _, g in ipairs(garages) do
    print(string.format("Garage: %s | Type: %s | Transfer Fee: $%d", g.name, g.type, g.fee))
end
```

***

### `GetCurrentGarage`

Gets information about the garage zone the player is currently standing inside.

```lua
local current = exports['ak47_garage']:GetCurrentGarage()
```

#### Return Values

| Field       | Type              | Description                                                |
| ----------- | ----------------- | ---------------------------------------------------------- |
| `name`      | `string\|boolean` | Current garage ID/name, or `false` if not inside a garage. |
| `garage`    | `table\|nil`      | Full garage configuration object, or `nil` if outside.     |
| `anyGarage` | `boolean`         | Value of `Config.AnyGarage`.                               |

#### Example

```lua
local current = exports['ak47_garage']:GetCurrentGarage()
if current.name then
    print("Player is inside garage:", current.name)
else
    print("Player is not in any garage zone.")
end
```

***

### `IsInsideGarage`

Checks if the player is currently standing inside any garage polyzone.

```lua
local isInside = exports['ak47_garage']:IsInsideGarage()
```

#### Return Values

| Type      | Description                                                                |
| --------- | -------------------------------------------------------------------------- |
| `boolean` | `true` if the local player is inside a garage boundary, `false` otherwise. |

#### Example

```lua
if exports['ak47_garage']:IsInsideGarage() then
    -- Show custom HUD element or prompt
end
```

***

### `GetInsideGarageId`

Retrieves the ID (name) of the garage zone the player is currently occupying.

```lua
local gid = exports['ak47_garage']:GetInsideGarageId()
```

#### Return Values

| Type          | Description                                   |
| ------------- | --------------------------------------------- |
| `string\|nil` | Garage identifier if inside a zone, or `nil`. |

***

### `GetGarageData`

Retrieves the complete internal data object for a specific garage ID.

```lua
local data = exports['ak47_garage']:GetGarageData(gid)
```

#### Parameters

| Parameter | Type     | Required | Description                   |
| --------- | -------- | -------- | ----------------------------- |
| `gid`     | `string` | **Yes**  | The unique garage identifier. |

#### Return Values

| Type         | Description                                                                                                                     |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------- |
| `table\|nil` | Full garage object containing `polyzone`, `spawns`, `setting`, `realparked`, `reposition`, `trailerpos`, or `nil` if not found. |

***

### `OpenGarage`

Programmatically opens the 3D Showroom and NUI Garage Menu for the specified garage (or current zone).

```lua
local success = exports['ak47_garage']:OpenGarage(gid)
```

#### Parameters

| Parameter | Type     | Required | Description                                                |
| --------- | -------- | -------- | ---------------------------------------------------------- |
| `gid`     | `string` | No       | Optional garage ID to open. If omitted, uses current zone. |

#### Return Values

| Type      | Description                                                                      |
| --------- | -------------------------------------------------------------------------------- |
| `boolean` | `true` if successfully opened, `false` if target garage could not be determined. |

#### Example

```lua
-- Open Legion Square garage programmatically via an NPC interaction or radial menu
exports['ak47_garage']:OpenGarage("Legion Square")
```

***

### `CloseGarage`

Programmatically closes the garage menu UI, fades the screen in, and destroys the preview showroom camera and vehicle.

```lua
local closed = exports['ak47_garage']:CloseGarage()
```

#### Return Values

| Type      | Description                                              |
| --------- | -------------------------------------------------------- |
| `boolean` | `true` if garage was open and closed, `false` otherwise. |

***

### `IsGarageOpenUI`

Checks if the garage NUI menu and showroom camera are currently open.

```lua
local isOpen = exports['ak47_garage']:IsGarageOpenUI()
```

#### Return Values

| Type      | Description                              |
| --------- | ---------------------------------------- |
| `boolean` | `true` if UI is open, `false` otherwise. |

***

### `SpawnVehicle`

Spawns a vehicle from the garage by its license plate.

```lua
exports['ak47_garage']:SpawnVehicle(plate, targetGid)
```

#### Parameters

| Parameter   | Type     | Required | Description                                   |
| ----------- | -------- | -------- | --------------------------------------------- |
| `plate`     | `string` | **Yes**  | License plate of the vehicle to spawn.        |
| `targetGid` | `string` | No       | Optional garage ID. Defaults to current zone. |

#### Example

```lua
exports['ak47_garage']:SpawnVehicle("AK47", "Legion Square")
```

***

### `ParkCurrentVehicle`

Parks the vehicle the local player is currently seated in into the garage zone.

```lua
local success = exports['ak47_garage']:ParkCurrentVehicle(gid)
```

#### Parameters

| Parameter | Type     | Required | Description                                   |
| --------- | -------- | -------- | --------------------------------------------- |
| `gid`     | `string` | No       | Optional garage ID. Defaults to current zone. |

#### Return Values

| Type      | Description                                                                                            |
| --------- | ------------------------------------------------------------------------------------------------------ |
| `boolean` | `true` if parking procedure was initiated, `false` if player is not in a vehicle or garage is invalid. |

***

### `StartTabletAnim`

Plays the tablet animation and attaches the `prop_cs_tablet` entity to the player's ped.

```lua
exports['ak47_garage']:StartTabletAnim()
```

***

### `StopTabletAnim`

Stops the tablet animation and deletes the attached tablet prop from the player's ped.

```lua
exports['ak47_garage']:StopTabletAnim()
```

***

### `PayRealFee`

Executes payment for real parking fee if parking fees are enabled for the specified garage.

```lua
local paid = exports['ak47_garage']:PayRealFee(gid, plate)
```

#### Parameters

| Parameter | Type     | Required | Description            |
| --------- | -------- | -------- | ---------------------- |
| `gid`     | `string` | **Yes**  | Garage identifier.     |
| `plate`   | `string` | **Yes**  | Vehicle license plate. |

#### Return Values

| Type      | Description                                                                  |
| --------- | ---------------------------------------------------------------------------- |
| `boolean` | `true` if payment succeeded or not required, `false` if player lacked funds. |

***

### `TakeVehiclePhoto`

Spawns the vehicle silently in the photo studio room, positions the camera using dimension/class presets, captures an image using `screenshot-basic`, and uploads it to FiveManage.

```lua
exports['ak47_garage']:TakeVehiclePhoto(plate)
```

#### Parameters

| Parameter | Type     | Required | Description                                 |
| --------- | -------- | -------- | ------------------------------------------- |
| `plate`   | `string` | **Yes**  | License plate of the vehicle to photograph. |

#### Example

```lua
exports['ak47_garage']:TakeVehiclePhoto("AK47")
```

***

### `GetPhotoPreset`

Calculates and returns the camera positioning preset configuration for a given vehicle model based on dimensions or vehicle class.

```lua
local presetName, presetConfig = exports['ak47_garage']:GetPhotoPreset(modelHash)
```

#### Parameters

| Parameter   | Type             | Required | Description                              |
| ----------- | ---------------- | -------- | ---------------------------------------- |
| `modelHash` | `number\|string` | **Yes**  | Vehicle model hash or model name string. |

#### Return Values

| Value          | Type     | Description                                                                                                           |
| -------------- | -------- | --------------------------------------------------------------------------------------------------------------------- |
| `presetName`   | `string` | Preset key (e.g., `small`, `compact`, `medium`, `large`, `xlarge`, `xxlarge`, `boat_small`, `aircraft_medium`, etc.). |
| `presetConfig` | `table`  | Preset details containing `CamCoords`, `CamRotation`, and `Fov`.                                                      |

***

### `GetVehicleType`

Resolves the garage vehicle classification category for a vehicle model.

```lua
local vType = exports['ak47_garage']:GetVehicleType(model)
```

#### Parameters

| Parameter | Type             | Required | Description                              |
| --------- | ---------------- | -------- | ---------------------------------------- |
| `model`   | `number\|string` | **Yes**  | Vehicle model hash or model name string. |

#### Return Values

| Type     | Description                                                                                       |
| -------- | ------------------------------------------------------------------------------------------------- |
| `string` | Category: `"automobile"`, `"bike"`, `"boat"`, `"heli"`, `"plane"`, `"submarine"`, or `"trailer"`. |

***

### `IsVehicleCompatible`

Checks if a given vehicle model is allowed to be parked in the specified garage type category.

```lua
local isCompatible = exports['ak47_garage']:IsVehicleCompatible(model, garageType)
```

#### Parameters

| Parameter    | Type             | Required | Description                                                  |
| ------------ | ---------------- | -------- | ------------------------------------------------------------ |
| `model`      | `number\|string` | **Yes**  | Vehicle model hash or string name.                           |
| `garageType` | `string`         | **Yes**  | Target garage type (`"car"`, `"boat"`, `"heli"`, `"plane"`). |

#### Return Values

| Type      | Description                              |
| --------- | ---------------------------------------- |
| `boolean` | `true` if compatible, `false` otherwise. |

***

### `GetVehicleRealStats`

Calculates live performance metrics, handling physics, power, weight, and rarity for a vehicle model.

```lua
local stats = exports['ak47_garage']:GetVehicleRealStats(modelHash, vehicleEntity)
```

#### Parameters

| Parameter       | Type             | Required | Description                                                           |
| --------------- | ---------------- | -------- | --------------------------------------------------------------------- |
| `modelHash`     | `number\|string` | **Yes**  | Vehicle model hash or name.                                           |
| `vehicleEntity` | `number`         | No       | Optional active vehicle entity handle for live handling calculations. |

#### Return Values

| Field          | Type     | Description                                            |
| -------------- | -------- | ------------------------------------------------------ |
| `topSpeed`     | `number` | Estimated top speed in km/h.                           |
| `acceleration` | `string` | 0-100 km/h acceleration rating in seconds.             |
| `handling`     | `number` | Handling score (0 - 100).                              |
| `braking`      | `number` | Braking score (0 - 100).                               |
| `driveType`    | `string` | Drive layout (`"AWD"`, `"RWD"`, `"FWD"`).              |
| `power`        | `string` | Calculated horsepower (e.g., `"450 HP"`).              |
| `weight`       | `string` | Mass (e.g., `"1650 KG"`).                              |
| `rarity`       | `string` | Tier: `"COMMON"`, `"UNCOMMON"`, `"RARE"`, or `"EPIC"`. |

***

### `GetVehicleRarity`

Calculates the rarity tier based on performance factors and weights configured in `Config.Rarity`.

```lua
local tier = exports['ak47_garage']:GetVehicleRarity(maxSpeed, accel, handling, braking)
```

#### Parameters

| Parameter  | Type     | Required | Description               |
| ---------- | -------- | -------- | ------------------------- |
| `maxSpeed` | `number` | **Yes**  | Top speed in km/h.        |
| `accel`    | `number` | **Yes**  | Acceleration stat.        |
| `handling` | `number` | **Yes**  | Handling score (0 - 100). |
| `braking`  | `number` | **Yes**  | Braking score (0 - 100).  |

#### Return Values

| Type     | Description                                      |
| -------- | ------------------------------------------------ |
| `string` | `"COMMON"`, `"UNCOMMON"`, `"RARE"`, or `"EPIC"`. |
