# Events

## Client

### Open garage

This event can be used to open a specific garage, such as via a radial menu.  If the `garageId` is a registered garage (i.e. specified in the config), it will perform a location check automatically for security.

```lua
-- garageId: string
-- vehicleType?: "car" | "air" | "sea"
-- spawnCoords?: vector4 | Only needed for unknown/house garage integrations
TriggerEvent("jg-advancedgarages:client:open-garage", garageId, vehicleType, spawnCoords)
```

### Store current vehicle

This event can be used to store the vehicle into a garage. If the `garageId` is a registered garage (i.e. specified in the config), it will perform a location check automatically for security.

```lua
--garageId: string
--garageVehicleType: "car" | "sea" | "air"
--return: boolean success
TriggerEvent("jg-advancedgarages:client:store-vehicle", garageId, garageVehicleType)
```

### Show impound form

Show the impound form (if you have permissions) - useful for showing via a radial menu, item, or key bind.

```lua
TriggerEvent("jg-advancedgarages:client:show-impound-form")
```

### Show private garages manager

This event can be used to open the private garages dashboard so a private garage can be created, edited or deleted.

```lua
TriggerEvent("jg-advancedgarages:client:show-private-garages-dashboard")
```

### Show change plate form

This event can be used to open the change plate UI.

```lua
-- vehicle?: integer
TriggerEvent("jg-advancedgarages:client:show-vplate-form", vehicle)
```

## Server

### Register vehicle outside \[deprecated]

{% hint style="danger" %}
This event has been deprecated and will be removed in a future release.
{% endhint %}

```lua
--plate: string
--netId: integer
TriggerEvent("jg-advancedgarages:server:register-vehicle-outside", plate, netId)
```

<br>


---

# 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://docs.jgscripts.com/advanced-garages/commands-events-and-exports/events.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.
