> For the complete documentation index, see [llms.txt](https://kucluck.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kucluck.gitbook.io/docs/garage/kc-garage-v1/functions.md).

# 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>
