> For the complete documentation index, see [llms.txt](https://docs.l2s.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.l2s.dev/assets-and-guides/hotels-v2/installation.md).

# Installation

## # STEP 1 - Check dependencies

Make sure you have installed all  [dependencies ](/assets-and-guides/hotels-v2.md).

## # STEP 2 - Drag And Drop

Drag and drop the  <mark style="color:blue;">l2s-hotels</mark> to your resources folder.

## # STEP 3 - Setup Maps

To benefit from all the features of the script, you must purchase maps designated for the script , or add your hotel configuration.

{% embed url="<https://nooris-3d.tebex.io/package/5555935>" %}

{% embed url="<https://fivem.gnstud.io/category/subscription>" %}

## # STEP 4 - SQL Insert

Insert the SQL file to your database.

## # STEP 5 - Setup Items and Images

Set Up Items According to your inventory

{% tabs %}
{% tab title="qb-inventory" %}
1- Add Items in qb-core/shared/items.lua

```lua
    ["hotels_key"] = { 
        ["name"] = "hotels_key",
        ["label"] = "Room Access",
        ["weight"] = 100, 
        ["type"] = "item",
        ["image"] = "hotels_key.png",
        ["unique"] = true,
        ["useable"] = true,
        ["shouldClose"] = false,
        ["combinable"] = nil,
        ["description"] = "Hotel Room Access" 
    },

```

\
2- Add Image in qb-inventory/html/images/...<br>

{% file src="/files/HXI1wE8kpp5KafslQo0P" %}

\
3-Add Item Info (optional) in qb-inventory/html/js/app.js

<pre class="language-javascript"><code class="lang-javascript">case "hotels_key":
    return `&#x3C;p>&#x3C;strong>Room: &#x3C;/strong>&#x3C;span>${itemData.info.room}&#x3C;/span>&#x3C;/p>
    &#x3C;p>&#x3C;strong>Hotel: &#x3C;/strong>&#x3C;span>${itemData.info.hotel}&#x3C;/span>&#x3C;/p>
    &#x3C;p>&#x3C;strong>Serial Number: &#x3C;/strong>&#x3C;span>${itemData.info.cardnumber}&#x3C;/span>&#x3C;/p>`;
<strong>
</strong></code></pre>

{% endtab %}

{% tab title="ox\_inventory" %}
1- Add Items in ox\_inventory/data/items.lua

QBCore:

```lua
['hotels_key'] = {
    label = 'Hotel Key',
    weight = 100,
},
```

ESX:

```lua

["hotels_key"] = {
	label = "Hotel Key",
	weight = 100,
	stack = false,
	close = true,
	client = {
		event = 'l2s-hotels:client:ToggleDoor',
	},
},

```

\
2- Add Image in  ox\_inventory/web/images/...<br>

{% file src="/files/DpXBhmZPT30QisJbPtd7" %}
{% endtab %}

{% tab title="qs\_inventory" %}
1- Add Items in qb-core/shared/items.lua  or or  qs-inventory/config/metadata.js for esx

```lua
    ["hotels_key"] = { 
        ["name"] = "hotels_key",
        ["label"] = "Room Access",
        ["weight"] = 100, 
        ["type"] = "item",
        ["image"] = "hotels_key.png",
        ["unique"] = true,
        ["useable"] = true,
        ["shouldClose"] = false,
        ["combinable"] = nil,
        ["description"] = "Hotel Room Access" 
    },
```

\
2- Add Image in qs-inventory/html/images/...<br>

{% file src="/files/J6kUxBJ8UaNc1yMQtpFO" %}

\
3-Add Item Info (optional) in qs-inventory/config/metadata.js

```javascript
    } else if (itemData.name == "hotels_key") {
        $(".item-info-title").html("<p>" + `${itemData.info.label || label}` + "</p>");
        $(".item-info-description").html(
            "<p>Hotel:<span>" +
            itemData.info.hotel+
            "<p>Room:<span>" +
            itemData.info.room +
            "</span>Key:</p><span>" +
            itemData.info.cardnumber+ "</span></p>"
        );



```

{% endtab %}

{% tab title="l2s-inventory" %}
1- Add Items in qb-core/shared/items.lua

```lua
    ["hotels_key"] = { 
        ["name"] = "hotels_key",
        ["label"] = "Room Access",
        ["weight"] = 100, 
        ["type"] = "item",
        ["image"] = "hotels_key.png",
        ["unique"] = true,
        ["useable"] = true,
        ["shouldClose"] = false,
        ["combinable"] = nil,
        ["description"] = "Hotel Room Access" 
    },
```

\
\
2- Add Image in qb-inventory/html/images/...<br>

{% file src="/files/mulPEcqSy2KhmS5P3VRT" %}

\
3-Add Item Info (optional) in l2s-inventory/html/js/app.js

```javascript
         } else if (itemData.name == "hotels_key") {
            $(".theiteminfo-title").html('<p>Room Access</p>')

            $(".item-info-block-desc").html(
                "</div></div> <div class='item-info-block-oneinfo'> <div class='item-info-block-oneinfo-title'>Hotel: </div> <div class='item-info-block-oneinfo-text'>" +
                itemData.info.hotel +
                "</div></div> <div class='item-info-block-oneinfo'> <div class='item-info-block-oneinfo-title'>Room Number: </div> <div class='item-info-block-oneinfo-text'>" +
                itemData.info.room +
                "</div></div> <div class='item-info-block-oneinfo'> <div class='item-info-block-oneinfo-title'>Card Number: </div> <div class='item-info-block-oneinfo-text'>" +
                itemData.info.cardnumber +
                "</div></div>"
            );   
```

{% endtab %}
{% endtabs %}

{% hint style="danger" %} <mark style="color:red;">Important</mark>:  if you use ox\_inventory ,  you should add this code in : <mark style="color:blue;">ox\_inventory/modules/inventory/server.lua</mark>
{% endhint %}

```lua
exports('RegisteredStashes', function()
	return RegisteredStashes
end)

exports('RemoveRegisteredStash', function(stash)
	exports.ox_inventory:ClearInventory(stash)
	MySQL.update.await('DELETE FROM ox_inventory WHERE name = ?', { stash })
	RegisteredStashes[stash] = nil
end)
```

## # STEP 6 - For (**cfx\_gn\_von\_hotel\_rockford**)

If you're using the GN Rockford Hotel map, navigate to the following directory:\
&#x20;:file\_folder: `cfx_gn_von_hotel_rockford\script_loader\client`,

Then, add the following code to the last line of the file.

```lua
AddEventHandler('gn-studio:loadfloor', function(floor)
    if floor == 1 then
        loadEtage1()
    elseif floor == 2 then
        loadEtage2()
    elseif floor == 3 then
        loadEtage3()
    elseif floor == 4 then
        loadEtage4()
    elseif floor == 5 then
        loadEtage5()
    elseif floor == 6 then
        loadEtage6()
    elseif floor == 7 then
        loadEtage7()
    end
end)


AddEventHandler('gn-studio:unLoad', function(floor)
    UnloadIpl()
end)
```

**And this line before any elevator therad:**

```lua
Wait(2000)
if GetResourceState('l2s-hotels') ~= 'missing' then  return end
```

## # STEP 7 - Start The Script

1 - Start the script on your  <mark style="color:blue;">server.cfg</mark>

```cfscript
ensure l2s-hotels
```
