> For the complete documentation index, see [llms.txt](https://oph3zdev.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://oph3zdev.gitbook.io/docs/free/house/installation.md).

# Installation

Installation of this resource

## Step 1 - Download And Drag

Download the file from keymaster and drag the file into your resources folder.

## Step 2 - Insert SQL File

Insert the SQL file in the folder to your database

## Step 3 - Config Configuration

Edit this part according to your own needs.

{% code title="config/config.lua" %}

```lua
Config = {}
CodeReal = {}

Config.Framework = 'newesx' -- newesx, oldesx, newqb, oldqb
Config.MySQL = 'oxmysql' -- oxmysql, ghamattimysql, mysql-async | Don't forget to edit fxmanifest.lua

Config.AllowToBuyMoreThanOne = true -- If true, players can buy more than 1 house.
Config.GiveRentSystem = true -- If you want to enable a system where players can rent houses to each other, set this true.
Config.RentTime = 7 -- Days | The time period initially given when the player rents the house
Config.SendMailToPlayer = false -- If true, it sends an email to the player's phone if the player's lease has expired. | If you set 'true', then you need to edit config/server_config.lua
CodeReal.Bill = 'SwedenEstate' -- You can change it however you like, but only use English characters to avoid problems!
Config.SellHouseRatio = 2 -- 2 => 50% | Since 2 is written here, if the player sells the house, system will divide the normal price of the house by 2 and give it to the player.
Config.CopyKeyPrice = 100 -- The fee for copying the key to the house.
Config.AddDayPrice = 100 -- If 100, when player want to extend rent time, 1 day = 100$

Config.GiveVehicleKeys = true -- A system of giving keys to the player after taking cars out from the garage
Config.VehicleKeySystem = 'qb-vehiclekeys' -- qb-vehiclekeys, qs-vehiclekeys, wasabi-carlock, cd_garage, custom | If you choose 'custom' you need to edit config/client_config.lua

Config.CheckVehicleOwner = true -- If there is a friend of the house and this option is true, then when a player takes the car out of the garage, system checks whether the car belongs to the person who tried to take it out. But if it is false, it takes the car out of the garage directly.

Config.WardrobeSystem = 'qb-clothing' -- qb-clothing, fivem-appearance, illenium-appearance, esx_skin, custom | If you choose 'custom' you need to edit config/client_config.lua

Config.InventorySystem = 'ox_inventory' -- qb-inventory, ox_inventory
Config.HouseStashSlot = 50 -- Stash slot amount
Config.HouseStashWeight = 250 -- Stash weight limit

Config.CheckRentStatus = { -- Check time for rented houses. For example, if you write 00:00 here, it will check every day at 00:00.
    Hour = 00,
    Minute = 42
}

Config.Notification = function(msg, type, server, src)
    if server then
        if Config.Framework == 'newqb' or Config.Framework == 'oldqb' then
            TriggerClientEvent('QBCore:Notify', src, msg, type, 4000)
        else
            TriggerClientEvent('esx:showNotification', src, msg)
        end
    else
        if Config.Framework == 'newqb' or Config.Framework == 'oldqb' then
            TriggerEvent('QBCore:Notify', msg, type, 4000)
        else
            TriggerEvent('esx:showNotification', msg)
        end
    end
end
```

{% endcode %}

## Step 4 - Edit SQL Table

For the garage system to work correctly, add the two rows in you see in on the screenshot to the player\_vehicles table. If you are using ESX you will do the same but in the owner\_vehicles table.

<figure><img src="https://2048929190-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIwQ369U2PuFWD7Lp25Wv%2Fuploads%2F08MkH2nNAggKYBjlOefR%2Fimage.png?alt=media&amp;token=e9c05de4-e9e8-44ed-9e78-1fbbf500348f" alt=""><figcaption></figcaption></figure>

## Step 5 - Inventory Configuration

Add the code given at the bottom according to the inventory you are using.

### qb-inventory:

{% code title="qb-core/shared/items.lua" %}

```lua
['housekeys']                       = {['name'] = 'housekeys',                         ['label'] = 'House Keys',                 ['weight'] = 50,         ['type'] = 'item',         ['image'] = 'housekeys.png',             ['unique'] = true,         ['useable'] = true,     ['shouldClose'] = true,   ['combinable'] = nil,   ['description'] = 'Seems like house keys...'},
```

{% endcode %}

{% code title="qb-inventory/html/js/app.js" %}

```javascript
} else if (itemData.name == "housekeys") {
    $(".item-info-title").html('<p>'+itemData.label+'</p>')
    $(".item-info-description").html('<p><strong></strong><span>House NO: ' + itemData.info.house + '</span></p>');
```

{% endcode %}

### ox\_inventory:

{% code title="ox\_inventory/data/items.lua" %}

```lua
 ['housekeys'] = {
     label = 'House Keys',
     weight = 1,
     consume = 0,
     stack = false,
     close = true,
     server = {
         export = 'real-house.housekeys'
     }
},
```

{% endcode %}

## Step 6 - Discord Configuration

Go to config/server\_config.lua and paste your discord bot token for profile picture.

<figure><img src="https://2048929190-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIwQ369U2PuFWD7Lp25Wv%2Fuploads%2FHwSAImWWfPVxF3hecpNU%2Fimage.png?alt=media&amp;token=a2d1fd77-f8a8-45a0-8feb-609db960c98a" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
If you don't know how to create a discord bot token, you can watch the video below:

<https://www.youtube.com/watch?v=zrNloK9b1ro>
{% endhint %}
