# Vehicle Shop

## **Overview**

This **Advanced Vehicle Shop** script allows players to **purchase** or **test-drive** vehicles from various shops across the map. Whether you’re running ESX or QBCore, the script auto-detects your framework, supports job-based restrictions, handles custom license plates, spawns preview vehicles, offers test drives, and can store purchased vehicles in a database.

## **Key Highlights:**

* **Multi-Shop System:** Define multiple shops (e.g., Police Shop, Medic Shop, Public Car Shop) with unique coordinates, NPCs, and categories.
* **Job & Rank Checks:** Restrict vehicle categories to certain job ranks or a range of job grades.
* **Vehicle Preview & Camera System:** Players can preview vehicles in a separate area and rotate or zoom in/out on them.
* **Test Drive Feature:** Let players test a vehicle for a certain time before auto-returning them to the shop.
* **Custom Plates & Pricing:** Generate random or custom plates; enable random color or user-chosen color.
* **Supports ESX/QBCore:** Auto-detection logic for frameworks or set it manually.
* **Database Storage:** Optionally save purchased vehicles in <mark style="color:yellow;">`owned_vehicles`</mark> (ESX) or <mark style="color:yellow;">`player_vehicles`</mark> (QBCore).

## <mark style="color:yellow;">**Preview Video**</mark>

{% embed url="<https://www.youtube.com/watch?v=5nAgddeD1OQ>" %}


---

# 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://risk-scripts.gitbook.io/risk-scripts/scripts/vehicle-shop.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.
