# Installation

{% hint style="info" %}

```
With the 4.0, the motel is now automatically adapting to your server.
But you need to make some minor changes.
```

{% endhint %}

{% hint style="danger" %}
If you are using motel for the first time, don't install sql immediately. Motel makes automatically create tables. Just check for errors on cmd.
{% endhint %}

<figure><img src="https://2054689962-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2jFzR30XlKSdobBggZNg%2Fuploads%2FonzYaIrJKKlqBQFOH25Z%2FScreenshot_1.png?alt=media&#x26;token=8bb7b379-8e20-44a2-8a21-dcdbd0de2cac" alt=""><figcaption><p>Cmd should look like this</p></figcaption></figure>

## Stash

First of all, the stash items are not dependent on the players. It depends on the rooms. So if a player leaves the room, room's items are not deleted.

{% hint style="info" %}
You can turn this off by setting personalStashes to false
{% endhint %}

* There are four inventory supported by the motel. If you are not using one of these, you can use the motel's inventory
* If you don't change the Config.stashSettings. Stashes is automatically changed by the motel.

{% hint style="info" %}
If you are using qs-inventory you don't need to change anything.
{% endhint %}

{% tabs %}
{% tab title="standalone" %}

## This is a menu based inventory.

So, it doesn't need an inventory hud. If you have an unsupported inventory, don't worry! I have something good for you.

### Limit

```
You can specify a stash limit.
```

> mx-motels/shared/config.lua

```lua
inventoryLimit = 100 -- How much inventory space will the motel have? [just for standalone inventory]
```

{% endtab %}

{% tab title="qb-inventory" %}

### There are two things you need to do

* ```
  Add the item you used on Config.metaitem to your item list. 
  By default it's motelkey.
  ```
* ```
  Change the Config.stashSettings. You can get reference below.
  ```

### References

> #### Items
>
> Add your item to `qb-core > shared.lua`

<pre class="language-lua"><code class="lang-lua"><strong>["motelkey"] = {
</strong>    ["name"] = "motelkey",
    ["label"] = "Motel Key",
    ["weight"] = 0,
    ["type"] = "item",
    ["image"] = "motelkey.png",
    ["unique"] = true,
    ["useable"] = true,
    ["shouldClose"] = true,
    ["combinable"] = nil,
    ["description"] = "Motel Key"
},
</code></pre>

> #### Stash Config
>
> mx-motels > shared > config.lua

```lua
stashSettings = {
    maxweight = 4000000,
    slots = 500,
},
```

### OPTIONAL

{% hint style="warning" %}

```
You don't have to do this. 
If you do, it will show the room number in the item information.
```

{% endhint %}

> Go to `qb-inventory > html > js > app.js`&#x20;

{% hint style="info" %}
Function Name: `FormatItemInfo`
{% endhint %}

```javascript
}else if (itemData.name == 'motelkey') {
    $(".item-info-title").html('<p>'+itemData.label+'</p>');
    $(".item-info-description").html('<p>Motel Key: ' + itemData.info.motel + '</p>');
```

<figure><img src="https://2054689962-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2jFzR30XlKSdobBggZNg%2Fuploads%2F8phHlaECwmySJ82BY8xw%2FScreenshot_1.png?alt=media&#x26;token=b98b4e2e-e3f7-4166-8ac1-aa732c76706f" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="ox\_inventory" %}

### Same with the qb-inventory,  two things.

* ```
  Add the item you used on Config.metaitem to your item list. 
  By default it's motelkey.
  ```
* ```
  Change the Config.stashSettings. You can get reference below.
  ```

### References

> #### Items
>
> Add your item to `ox_inventory > data > items.lua`

```lua
['motelkey'] = {
    label = 'Motel Key',
    weight = 0.250,
    stack = true,
    close = true,
    client = {export = 'mx-motels.motels:UseKey'}
},
```

> #### Stash Config
>
> mx-motels > shared > config.lua

```lua
stashSettings = {
    maxweight = 4000000,
    slots = 500,
},
```

{% endtab %}

{% tab title="disc-inventoryhud" %}

### Just one thing.

```
Change the Config.stashSettings. You can get reference below.
```

### References

> mx-motels > shared > config.lua

```lua
stashSettings = {
    slots = 80,
    weight = 50
},
```

{% endtab %}
{% endtabs %}
