# Commands

## 🎮 **Client-Side Commands**

### **lock**

* **Description:** Locks or unlocks the nearest vehicle.
* **Usage:** `/lock`

### **engine**

* **Description:** Toggles the engine of the nearest vehicle.
* **Usage:** `/engine`

### **garageBlips**

* **Description:** Toggles the visibility of garage blips on the map.
* **Usage:** `/garageBlips`

### **park**

* **Description:** Parks the closest vehicle into a garage.
* **Usage:** `/park`

### **impound**

* **Description:** Sends a vehicle to impound.
* **Usage:** `/impound`

### **fakeplate**

* **Description:** Takes the plate of the nearest vehicle.
* **Usage:** `/plate`

### **vincheck**

* **Description:** Checks the VIN of a vehicle.
* **Usage:** `/vincheck`

### forceCloseGarage

* **Description:** Closes UI of the garage if the player gets stuck
* **Usage:** `/forceCloseGarage`

### **refreshUiLang**

* **Description:** Refreshes the language settings of the UI.
* **Usage:** `/refreshUiLang`

***

## 🖥️ **Server-Side Commands**

### **refreshAllVehicles**

* **Description:** Refreshes all stored vehicles in the database.
* **Usage:** `/refreshAllVehicles`

### **refreshOwnerVeh**

* **Description:** Refreshes the vehicles owned by a specific player.
* **Arguments:**
  * `owner` *(string)* – Owner of the vehicles.
* **Usage:** `/refreshOwnerVeh [owner]`

### **refreshPlate**

* **Description:** Updates vehicle plate information in the database.
* **Arguments:**
  * `plate` *(string)* – The plate number of the vehicle.
* **Usage:** `/refreshPlate [plate]`

### **setupGarageDatabase**

* **Description:** Sets up the database for garages.
* **Usage:** `/SetupGarageDatabase`

### **vehicleDetail**

* **Description:** Retrieves details of a specific vehicle.
* **Arguments:**
  * `plate` *(string)* – The plate number of the vehicle.
* **Usage:** `/vehicleDetail [plate]`

### **fixVehicle**

* **Description:** Repairs a broken vehicle and sets it onto default garage.
* **Usage:** `/fixVehicle`

### **setDefaultGarage**

* **Description:** Sets the default garage for a vehicle.
* **Usage:** `/setDefaultGarage`

### **deleteVehicle**

* **Description:** Deletes a vehicle from the database.
* **Usage:** `/deleteVehicle`

### **transferToSociety**

* **Description:** Transfers vehicle ownership to a society.
* **Usage:** `/transferToSociety`

### **saveAllVehicles**

* **Description:** Saves all vehicles to the database.
* **Usage:** `/saveAllVehicles`

***

## CanRunCommand Function Summary

### **Description**

The `CanRunCommand` function determines whether a player has the necessary permissions to execute a specific command in BHD Garage. It verifies the player's role and checks if they belong to an admin group or have specific access rights.

### **Arguments**

* `source` (number) – The player's source ID.
* `accessingCommand` (string) – The name of the command being accessed. Can be one of the following:
  * `vehicleMenu` – Opens the vehicle menu.
  * `giveKeys` – Gives keys to another player.
  * `deleteKeys` – Removes keys from another player.
  * `vehicleAdd` – Adds a new vehicle to the garage.
  * `vehicleRemove` – Removes a vehicle from the garage.
  * `deleteVehicle` – Deletes a vehicle from the system.
  * `setDefaultGarage` – Sets the default garage for a player or society.
  * `fixVehicle` – Repairs a damaged vehicle.

### **Function Logic**

1. If the `source` is `0`, the function automatically grants permission.
2. It retrieves the player's group using `Bridge.GetGroup(source)`.
3. If the command is `vehicleMenu`, only players with the `management` group can execute it.
4. If the player belongs to `SConfig.AdminGroups`, they are granted permission.
5. If the player lacks permission, they receive a notification.

### **Usage Example**

This function is primarily used to restrict access to administrative commands, ensuring that only authorized players can perform critical actions like deleting vehicles or setting default garages.
