> For the complete documentation index, see [llms.txt](https://docs.noctrastore.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.noctrastore.net/noctra-garage/commands-and-exports.md).

# Commands and exports

Public commands and exports provided by Noctra Garage.

The names below are the default command names. They can be changed or disabled in `config.lua`.

## Commands

| Command                  | Permission          | Description                                                                             |
| ------------------------ | ------------------- | --------------------------------------------------------------------------------------- |
| `/opencreator`           | Garage creator      | Opens the in-game garage creator.                                                       |
| `/impound`               | Allowed impound job | Opens the impound menu for vehicles within 5 meters.                                    |
| `/impdv <radius> [fine]` | Server admin        | Sends nearby owned vehicles to the nearest impound and removes nearby unowned vehicles. |

`/impdv` requires a radius between `1` and `Config.AdminImpoundCommand.maxRadius`. The fine is optional and defaults to `0`. Vehicles are processed nearest-first and the number handled in one run is limited by `Config.AdminImpoundCommand.maxVehicles`.

Setting `Config.ImpoundJobs = false` allows every job to use the normal impound command. The admin command always uses `FW.IsPlayerAdmin`.

## Client exports

### RequestSaveVehicle

Requests storage for the vehicle currently driven by the player.

```lua
local started = exports.noctra_garage:RequestSaveVehicle('legion_square')
```

| Parameter  | Type   | Description                             |
| ---------- | ------ | --------------------------------------- |
| `garageId` | string | ID of the garage receiving the vehicle. |

The export returns `true` when the request was sent. The normal server checks still apply, including distance, vehicle type, access, ownership restriction, and storage fee.

### OpenShowroom

Requests entry to a garage showroom.

```lua
local started = exports.noctra_garage:OpenShowroom('legion_square')
```

The export returns `false` when the garage ID is invalid or the player is already inside a garage. A `true` result means the request was sent; the server still checks that the garage and showroom are available to the player.

### RefreshGarageInteractions

Refreshes the garages and interactions available to the local player.

```lua
exports.noctra_garage:RefreshGarageInteractions()
```

Call this after a custom framework changes the player's job, gang, or another value used by garage access rules.

### OpenImpoundModal

Opens the nearby vehicle impound menu and returns after the player confirms, cancels, or the request times out.

```lua
local success, errorCode, result = exports.noctra_garage:OpenImpoundModal({
    impoundGarageId = 'police_impound', -- optional preferred garage
    account = 'bank'                    -- optional, defaults to bank
})
```

Client calls always respect `Config.ImpoundJobs`. `impoundGarageId` and `account` are optional. If no accessible impound garage exists, the export returns `false` with an error code.

## Server exports

### OpenImpoundModal

Opens the impound menu for an online player.

```lua
local success, errorCode, result = exports.noctra_garage:OpenImpoundModal(source, {
    impoundGarageId = 'police_impound', -- optional preferred garage
    account = 'bank',                   -- optional, defaults to bank
    checkJob = true                     -- optional, defaults to true
})
```

| Parameter         | Type    | Description                                                               |
| ----------------- | ------- | ------------------------------------------------------------------------- |
| `source`          | number  | Server ID of the player who will use the menu.                            |
| `impoundGarageId` | string  | Optional preferred impound garage. The player must be able to access it.  |
| `account`         | string  | Optional account used for the release fine. Defaults to `bank`.           |
| `checkJob`        | boolean | Set to `false` to skip `Config.ImpoundJobs` for this trusted server call. |

The return values are `success`, `errorCode`, and `result`. The result includes the processed plate, owner, destination, impound data, and whether the entity was removed when applicable.

### ImpoundVehicle

Impounds a known owned vehicle directly without opening the menu.

```lua
local success, errorCode, result = exports.noctra_garage:ImpoundVehicle({
    plate = 'ABC 123',
    owner = 'char1:license:example',
    impoundGarageId = 'police_impound',
    player = 'Officer Name',
    reason = 'Bad parking',
    fee = 500,
    account = 'bank',
    time = os.time()
}, vehicleEntity)
```

| Field             | Required | Description                                                                                           |
| ----------------- | :------: | ----------------------------------------------------------------------------------------------------- |
| `plate`           |    Yes   | Vehicle plate as stored in the database.                                                              |
| `owner`           |    Yes   | Owner identifier as stored in the framework vehicle table.                                            |
| `impoundGarageId` |    Yes   | Destination garage configured as an impound.                                                          |
| `player`          |    Yes   | Name recorded as the person who impounded it.                                                         |
| `reason`          |    Yes   | Reason shown in the impound record.                                                                   |
| `fee`             |    Yes   | Release fine. Use `0` for no fine.                                                                    |
| `time`            |    Yes   | Positive Unix timestamp, normally `os.time()`.                                                        |
| `account`         |    No    | Account used for the release fine. Defaults to `bank`.                                                |
| `snapshot`        |    No    | Current property and deformation snapshot if the calling resource already captured one.               |
| `vehicleEntity`   |    No    | Server-side vehicle handle. When provided and valid, the entity is removed after the database update. |

This export only updates a row that matches both the plate and owner and is not already impounded.

### SetVehiclePersistent

Adds an existing networked vehicle to the persistence system.

```lua
local success, status = exports.noctra_garage:SetVehiclePersistent(vehicleEntity)
```

Pass a **server-side entity handle**, not a network ID. The export captures the vehicle state before registering it. It returns `false, 'persistence_disabled'` when persistence is disabled.

### RemoveVehiclePersistence

Stops managing an existing vehicle through the persistence system.

```lua
local success, status = exports.noctra_garage:RemoveVehiclePersistence(vehicleEntity)
```

Pass a server-side entity handle. The persistence record is removed, but the vehicle entity remains in the world.

{% hint style="info" %}
`errorCode` and `status` values are intended for logging and control flow. Show a player-facing message from your own language file when integrating these exports into another resource.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.noctrastore.net/noctra-garage/commands-and-exports.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
