> For the complete documentation index, see [llms.txt](https://docs.menanak47.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.menanak47.com/qbcore/ak47_qb_housing/integration.md).

# Integration

## Enter House

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

```lua
TriggerEvent('ak47_qb_housing:enterhouse', houseid)
```

{% endtab %}

{% tab title="Server" %}

```lua
TriggerClientEvent('ak47_qb_housing:enterhouse', source, houseid)
```

{% endtab %}
{% endtabs %}

## Set Vehicle Fuel

Path: ak47\_qb\_housing/modules/garage/client/customizable.lua

<figure><img src="/files/OgP1BzxUHDtEKFtWsfBI" alt=""><figcaption></figcaption></figure>

## Give Key

Path: ak47\_qb\_housing/modules/garage/client/customizable.lua\
Set your export or trigger here to give vehicle key

<figure><img src="/files/NANKmqyt5pR8PlVPllvy" alt=""><figcaption></figcaption></figure>

## Garage Triggers

Path: ak47\_qb\_housing/modules/garage/client/customizable.lua

<figure><img src="/files/5rUGcSSm0DGNPamdFQYL" alt=""><figcaption></figcaption></figure>

### PS-MDT

Path: ps-mdt/server/dmb.lua

Replace: GetPlayerProperties

```lua
function GetPlayerProperties(cid, cb)
	local data =  MySQL.query.await('SELECT id, enter FROM ak47_qb_housing where owner = ?', {cid})
    local result = {}
    for i, v in pairs(data) do
        table.insert(result, {
            label = 'HID: '..v.id,
            coords = json.encode({enter = json.decode(v.enter)})
        })
    end
	return result
end
```

Path: ps-mdt/server/main.lua

Replace: GetPlayerPropertiesByCitizenId

```lua
function GetPlayerPropertiesByCitizenId(citizenid)
    local properties = {}
    local result = MySQL.Sync.fetchAll("SELECT * FROM ak47_qb_housing WHERE owner = @citizenid", {
        ['@citizenid'] = citizenid
    })
    if result and #result > 0 then
        for i = 1, #result do
            table.insert(properties, {
            	label = 'HID: '..result[i].id,
            	coords = json.encode({enter = json.decode(result[i].enter)})
            })
        end
    end
    return properties
end
```

### ZSX\_Multicharacter

```lua
-- add inside Characters.ConvertProperties function
if GetResourceState('ak47_qb_housing') == 'started' then
        local citizenResponse = MySQL.query.await("SELECT `citizenid` FROM `players` WHERE `license` LIKE '%"..identifier.."' AND `cid` = ?", {charId})
        local identifier = citizenResponse[1].citizenid
        local query = "SELECT * FROM `ak47_qb_housing` WHERE `owner` = ?"
        local response = MySQL.query.await(query, {identifier})
        
        if response and response[1] then
            for k,v in ipairs(response) do
                local coords = json.decode(v.enter)
                properties['house_'..v.id] = {
                    name = 'house_'..v.id,
                    type = "property",
                    label = 'House:'..v.id,
                    coords = vector3(coords.x, coords.y, coords.z),
                }
            end
        end
    end
```
