> For the complete documentation index, see [llms.txt](https://yuu-studio.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yuu-studio.gitbook.io/docs/y-garage/installation.md).

# Installation

## 1. Upload the Resource

Place the folder:

`y_garage`

inside your server resources directory.

**Example:**

`resources/[scripts]/y_garage`

### 2. Import the SQL File

Import the following file into your database:

`y_garage.sql`

**You can import it with:**

* phpMyAdmin
* HeidiSQL
* DBeaver
* Any MySQL client

### 3. Items

Add the following item to your `ox_inventory` items configuration:

```
['carkey'] = {
	label = 'Carkey',
	weight = 300,
	stack = false,
	client = {
		usetime = 0,
		event = 'y_garage:useKey'
	},
	buttons = {
		{
			label = 'Sell Vehicle',
			group = 'Options',
			action = function(slot)
				TriggerEvent('y_garage:sellCar', slot)
			end
		}
	}
},

['fakeplate'] = {
    label = 'Vehicle Plate',
    weight = 500,
    stack = false,
    close = true,
    description = 'A license plate',
    consume = 0,
    server = {
        export = 'y_garage.usePlate'
    }
},
```

### 4. Edit ES\_Extended

Edit this in es\_extended/client/functions.lua

```
if props.color1 ~= nil then
    if type(props.color1) == 'table' then
        SetVehicleCustomPrimaryColour(vehicle, props.color1[1], props.color1[2], props.color1[3])
    else
        SetVehicleColours(vehicle, props.color1, colorSecondary)
    end
end
if props.color2 ~= nil then
    if type(props.color2) == 'table' then
        SetVehicleCustomSecondaryColour(vehicle, props.color2[1], props.color2[2], props.color2[3])
    else
        SetVehicleColours(vehicle, props.color1 or colorPrimary, props.color2)
    end
end
```

### 5. Required Dependencies

Make sure the following resources are installed and started before this script:

* es\_extended
* ox\_lib
* oxmysql
* ox\_inventory
* ox\_target (optional)
