# Integration

## Enter House

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

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

{% endtab %}

{% tab title="Server" %}

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

{% endtab %}
{% endtabs %}

## Set Vehicle Fuel

<figure><img src="https://2088945756-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkHcyR2RbVMcj5NHJ2HEa%2Fuploads%2FzPLRMKBlfBRXF4mt8CCB%2Fimage.png?alt=media&#x26;token=fb710e5c-90ec-482c-9f27-b6473688049c" alt=""><figcaption></figcaption></figure>

## Give Key

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

<figure><img src="https://2088945756-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkHcyR2RbVMcj5NHJ2HEa%2Fuploads%2FzQe4QeF9ZogJ8BwmjyIr%2Fimage.png?alt=media&#x26;token=9b8290db-205f-4a70-b650-8ffef75483e5" alt=""><figcaption></figcaption></figure>

## Garage Triggers

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

<figure><img src="https://2088945756-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkHcyR2RbVMcj5NHJ2HEa%2Fuploads%2FWkZTglhV0a9h4jrWPXYI%2Fimage.png?alt=media&#x26;token=dbda8ad2-4456-4d1a-8dd2-fc46552b0e3d" alt=""><figcaption></figcaption></figure>

### ZSX\_Multicharacter

```lua
-- add inside Characters.ConvertProperties function
if GetResourceState('ak47_housing') == 'started' then
        local identifier = Config.Prefix..''..charId..':'..identifier
        local query = "SELECT * FROM `ak47_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
```
