Menan AK47
MENAN AK47DOCS
DiscordStore
Navigation
Menu
Welcome
FAQ
ak47_lib
ak47_target
ak47_ambulancejob
ak47_banking
ak47_business
ak47_carboosting
ak47_cardealer
ak47_clothingshop
ak47_crafting
ak47_crime
ak47_crutch
ak47_deliveryjob
ak47_drugdealerv2
ak47_drugmanagerv3
ak47_drugmissions
ak47_ecommerce
ak47_farming
ak47_fishing
ak47_fraudsystem
ak47_fuelstations
ak47_gangs
ak47_garage
ak47_garbagejob
ak47_hookahloungev2
ak47_housing
Installation
Configuration
Integration
Commands
Common Issues
ak47_hud
ak47_iclothingv3
ak47_idcardv2
ak47_inventory
ak47_jobgarage
ak47_khusbites
ak47_khusland
ak47_leafnlatte
ak47_mafiasupply
ak47_mechanic
ak47_moneywash
ak47_multicharacter
ak47_npcmed
ak47_outfitbag
ak47_playershop
ak47_policejob
ak47_prospecting
ak47_radio
ak47_rentalcar
ak47_safezone
ak47_sitchair
ak47_smokingv2
ak47_supermarket
ak47_switch
ak47_territories
ak47_vehiclekeys
ak47_vipshop
Loaf
DocsMulti FrameworkIntegration

Integration

Events

Enter House

Enters the specified property.

Client

TriggerEvent('ak47_housing:enterhouse', houseid)
Parameter Type Required Description
houseid number / string Yes Unique house ID

Server

TriggerClientEvent('ak47_housing:enterhouse', source, houseid)
Parameter Type Required Description
source number Yes Target player server ID
houseid number / string Yes Unique house ID

Third-Party Integrations

Garage Triggers

File path: ak47_housing/modules/garage/client/customizable.lua

Configure custom garage triggers in the client customizable module.

Garage Triggers

ZSX Multicharacter

Add inside the 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

PS-MDT

File path: ps-mdt/server/dmb.lua

Replace GetPlayerProperties:

function GetPlayerProperties(cid, cb)
    local data = MySQL.query.await('SELECT id, enter FROM ak47_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

File path: ps-mdt/server/main.lua

Replace GetPlayerPropertiesByCitizenId:

function GetPlayerPropertiesByCitizenId(citizenid)
    local properties = {}
    local result = MySQL.Sync.fetchAll("SELECT * FROM ak47_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
Previous
Configuration
Next
Commands
On this page
EventsEnter HouseThird-Party IntegrationsGarage TriggersZSX MulticharacterPS-MDT