> For the complete documentation index, see [llms.txt](https://izaap-studios.gitbook.io/izaap-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://izaap-studios.gitbook.io/izaap-scripts/garages-advanced/admin-commands.md).

# Admin Commands

### /givecar

* <pre><code><strong>Gives a vehicle to an **online** player by inserting it into the vehicle d
  </strong></code></pre>

> Usage

```md
/givecar <playerId> <model>
```

#### Arguments

* `playerId`: `number`\
  The server ID of the target player (must be connected).
* `model`: `string`\
  The vehicle spawn name (example: `t20`, `adder`, `sultan`).

#### Where you can use it

* Can be executed **while inside a vehicle or on foot**.
* The target player must be **online**.

#### What it does

* Generates a **unique plate** (checks the DB to avoid duplicates).
* Normalizes the model name (lowercase, no spaces).
* Creates a clean default vehicle props payload (fuel/engine/body defaults).
* Inserts the vehicle into your detected vehicles table:
  * **\[esx]** `owned_vehicles` (stores model name + JSON props in `mods` if available)
  * **\[qb] \[qbox]** `player_vehicles` (stores model string + hash + JSON props + condition)
* Notifies:
  * The admin who ran the command
  * The target player

#### Notes

* This command does **not** spawn the vehicle automatically in the world; it adds it to ownership/garage storage (depending on your system flow).
* If your ESX schema does not have `mods`, the script can create it (LONGTEXT) if configured to do so.

***

### /dvcar

Deletes a vehicle from the database by plate.

> Usage

```
/dvcar <plate>
```

#### Arguments

* `plate`: `string`\
  The plate to remove (spaces are ignored during normalization).

#### Where you can use it

* Can be executed **while inside a vehicle or on foot**.

#### What it does

* Normalizes the plate (uppercase, removes spaces).
* Deletes the matching record from the detected vehicles table:
  * **\[esx]** `owned_vehicles`
  * **\[qb] \[qbox]** `player_vehicles`
* Sends a result message:
  * Success if a row was deleted
  * Error if the plate was not found

#### Notes

* This deletes the vehicle from the **database**. If the vehicle is currently spawned in the world, it will remain spawned until your cleanup logic removes it.

***

### /changeplate

Changes the plate of an owned vehicle, updating both:

1. the plate column in the DB
2. the plate stored inside the vehicle JSON props

It also optionally updates inventory tables if present.

> Usage

```
/changeplate <oldPlate> <newPlate>
```

#### Arguments

* `oldPlate`: `string`\
  The current plate in the database.
* `newPlate`: `string`\
  The new plate to apply.

#### Rules / Validation

* `newPlate` must be **max 8 characters** (spaces not allowed after normalization).
* `newPlate` must be **different** from `oldPlate`.
* `newPlate` must **not exist** already in the database.

#### Where you can use it

* Can be executed **while inside a vehicle or on foot**.

#### What it does

* Updates the main vehicle row:
  * Sets the new plate in the plate column.
* Updates the stored JSON props to keep plate consistent:
  * **\[qb] \[qbox]** updates `mods/props` JSON.
  * **\[esx]** updates `mods/props` JSON when available, otherwise falls back to legacy storage (if JSON is stored in `vehicle` in older schemas).
* Optional: if these tables exist, it updates them too:
  * `trunkitems`
  * `gloveboxitems`

#### Notes

* This command is designed to prevent “split plates” where the DB plate differs from the JSON plate.
* If you run custom trunk/glovebox systems with different table names, those will not be updated unless you add them.
