# Functions

### 👮 Job Impound

* You can use in client

```lua
exports['kc_garage']:JobsImpound(ImpoundName, Vehicle, Identifier)
```

| Code Block  | Value            | Explanation                       |
| ----------- | ---------------- | --------------------------------- |
| ImpoundName | Impound key name | Your impound code name            |
| Vehicle     | Vehicle ID       | you can use `GetVehiclePedIsIn()` |
| Identifier  | Identifier       | Player identifier                 |

#### Example:

```lua
RegisterCommand('JobsImpound', function()
  local playerCoords = GetEntityCoords(PlayerPedId())
  local vehicle = GetClosestVehicle(playerCoords, 5.0)
  local playerData = ESX.GetPlayerData()
  exports['kc_garage']:JobsImpound('JobsImpound', vehicle, playerData.identifier)
end)
```

### 🅿️ Get Parking Zone

* You can use this to find out whether the player is in the garage zone or not

```lua
exports['kc_garage']:IsParkingZone()
```

#### Example:

```lua
RegisterCommand('_rad', function()
  local parkingZone = exports['kc_garage']:IsParkingZone()
  if not IsPauseMenuActive() and not inRadialMenu and not IsDown then
    if parkingZone then
      Config.MenuItems[6] = {
        id = 'parkiran',
        title = 'Parkiran',
        icon = 'square-parking',
        type = 'cmd',
        event = 'parking',
        shouldClose = true
      }
    else
      Config.MenuItems[6] = nil
    end

    openRadial(true)
    SetCursorLocation(0.5, 0.5)
  end
end)
```

### 🗒️ Get Garage Name

* You can get garages or impounds name in client or server

```lua
exports["kc_garage"]:GetGarageName(GaragesKeyName, ImpoundsKeyName)
```

| Code Block      | Value            | Explanation            |
| --------------- | ---------------- | ---------------------- |
| GaragesKeyName  | Garage key name  | Your garage code name  |
| ImpoundsKeyName | Impound key name | Your impound code name |

#### Example for find garages name:

<pre class="language-lua"><code class="lang-lua"><strong>## ESX Core
</strong>local garageName = exports['kc_newgarage']:GetGarageName(result[i].parking, false)
<strong>return garageName
</strong><strong>
</strong><strong>## QB Core
</strong>local garageName = exports['kc_newgarage']:GetGarageName(result[i].garage, false)
return garageName
</code></pre>

#### Example for find impounds name:

<pre class="language-lua"><code class="lang-lua">## ESX Core
local garageName = exports['kc_newgarage']:GetGarageName(false, result[i].parking)
<strong>return garageName
</strong><strong>
</strong><strong>## QB Core
</strong>local garageName = exports['kc_newgarage']:GetGarageName(false, result[i].garage)
return garageName
</code></pre>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kucluck.gitbook.io/docs/garage/kc-garage-v1/functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
