> For the complete documentation index, see [llms.txt](https://zloma-scripts.gitbook.io/zloma-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zloma-scripts.gitbook.io/zloma-scripts/zloma_vehicleshop-paid/api-reference/events.md).

# Events

## Integration Event

The main open integration event from the resource is:

```lua
AddEventHandler('zloma_vehicleshop:shopToggle', function(isOpen)
    -- isOpen = true when the shop UI opens
    -- isOpen = false when the shop UI closes
end)
```

This is intended for HUD, radial menu, or immersion resources that should hide or pause while the dealership UI is active.

***

## Server Events

| Event                                 | Description                                     |
| ------------------------------------- | ----------------------------------------------- |
| `zloma_vehicleshop:enterShopInstance` | Moves a player into a private showroom instance |
| `zloma_vehicleshop:leaveShopInstance` | Returns a player from the showroom instance     |
| `zloma_vehicleshop:stopJob`           | Stops an active delivery job                    |

***

## Client Events

| Event                             | Description                                    |
| --------------------------------- | ---------------------------------------------- |
| `zloma_vehicleshop:shopUpdated`   | Notifies clients that one salon changed        |
| `zloma_vehicleshop:shopsReloaded` | Notifies clients that all salons were reloaded |
| `zloma_vehicleshop:openBossMenu`  | Opens the dealership boss UI                   |
| `zloma_vehicleshop:onHired`       | Notifies the player they were hired            |
| `zloma_vehicleshop:onFired`       | Notifies the player they were fired            |
| `zloma_vehicleshop:updateBalance` | Pushes balance updates to the boss UI          |
| `zloma_vehicleshop:updateOrders`  | Pushes order-state updates to the boss UI      |

***

## Framework Lifecycle Events Used Internally

These are not custom API events, but they matter for integration awareness because the script listens to them:

* `esx:playerLoaded`
* `QBCore:Server:PlayerLoaded`
* `qbx:playerLoaded`
* `playerDropped`

The load events are used to refresh shop state for the connected player. `playerDropped` is used for cleanup of test drives and tuning cache data.

***

## Customization Hooks

In addition to runtime events, the open files provide function hooks:

* `OnShopOpen(shopData)`
* `OnShopClose()`
* `OnVehiclePurchased(plate, model, price)`
* `OnTestDriveStart(model)`
* `OnTestDriveEnd()`
* `OnServerVehiclePurchased(source, plate, spawnName, price, shopName)`
* `OnServerTradeInCompleted(source, oldPlate, newPlate, tradeinValue, finalPrice)`


---

# 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 dynamically by asking a question.

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

```
GET https://zloma-scripts.gitbook.io/zloma-scripts/zloma_vehicleshop-paid/api-reference/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.
