MenanAk47
  • Welcome
  • FAQ
  • ESX
    • ak47_whitewidowv2
      • Installation
      • Configuration
    • ak47_cannabiscafev2
      • Installation
      • Configuration
    • ak47_clothing
      • Installation
      • Configuration
      • Integration
      • Exports
      • Triggers
      • Commands
      • Common Issues
    • ak47_iclothingv3
      • Installation
    • ak47_switch
      • Installation
      • Commands
    • ak47_crutch
      • Installation
      • Triggers
      • Commands
    • ak47_housing
      • Installation
      • Configuration
      • Integration
      • Commands
      • Common Issues
    • ak47_cardealer
      • Installation
      • Configuration
      • Integration
      • Commands
      • Common Issues
    • ak47_ambulancejob
      • Installation
      • Guideline
      • Items
      • Integration
      • Commands
      • Triggers
      • Exports
    • ak47_gangs
      • Installation
      • Integration
      • Commands
      • Exports
    • ak47_garage
      • Installation
      • Integration
      • Commands
    • ak47_jobgarage
      • Installation
      • Integration
      • Commands
    • ak47_vehiclekeys
      • Installation
      • Integration
      • Commands
    • ak47_carboosting
      • Installation
      • Integration
      • Commands
    • ak47_safezone
      • Installation
      • Integration
      • Commands
    • ak47_inventory
      • Installation
      • Exports
        • Client
        • Server
      • Event Handlers
        • Client
        • Server
      • Commands
      • Guides
        • Custom Stash
        • External Shop
        • Protected Item
        • Convert Items
        • Show Info Value
      • Templates
        • Item
        • Weapon
        • Crafting
        • Stash
        • Shop
        • Vending
        • Dumpster
        • Tooltip
      • Modified Scripts
        • LegacyFuel
    • ak47_idcardv2
      • Installation
      • Integration
      • Commands
    • ak47_territories
      • Installation
      • Integration
      • Commands
      • Exports
  • QBCore
    • ak47_qb_whitewidowv2
      • Installation
      • Configuration
    • ak47_qb_cannabiscafev2
      • Installation
      • Configuration
    • ak47_qb_clothing
      • Installation
      • Configuration
      • Integration
      • Exports
      • Triggers
      • Commands
      • Common Issues
    • ak47_qb_iclothingv3
      • Installation
    • ak47_qb_switch
      • Installation
      • Commands
    • ak47_qb_crutch
      • Installation
      • Triggers
      • Commands
    • ak47_qb_wanted
      • Installation
      • Triggers
    • ak47_qb_housing
      • Installation
      • Configuration
      • Integration
      • Commands
      • Common Issues
    • ak47_qb_cardealer
      • Installation
      • Configuration
      • Integration
      • Commands
      • Common Issues
    • ak47_qb_ambulancejob
      • Installation
      • Guideline
      • Items
      • Integration
      • Commands
      • Triggers
      • Exports
    • ak47_qb_gangs
      • Installation
      • Integration
      • Commands
      • Exports
    • ak47_qb_garage
      • Installation
      • Integration
      • Commands
    • ak47_qb_jobgarage
      • Installation
      • Integration
      • Commands
    • ak47_qb_vehiclekeys
      • Installation
      • Integration
      • Commands
    • ak47_qb_carboosting
      • Installation
      • Integration
      • Commands
    • ak47_qb_safezone
      • Installation
      • Integration
      • Commands
    • ak47_qb_inventory
      • Installation
      • Exports
        • Client
        • Server
      • Event Handlers
        • Client
        • Server
      • Commands
      • Guides
        • Custom Stash
        • External Shop
        • Protected Item
        • Convert Items
        • Enable Weapon Wheel
        • Show Info Value
      • Templates
        • Item
        • Weapon
        • Crafting
        • Stash
        • Shop
        • Vending
        • Dumpster
        • Tooltip
      • Modified Scripts
        • LegacyFuel
    • ak47_qb_idcardv2
      • Installation
      • Integration
      • Commands
    • ak47_qb_territories
      • Installation
      • Integration
      • Commands
      • Exports
Powered by GitBook
On this page
  • Set Vehicle Fuel
  • Give Key
  • Garage Triggers
  • PS-MDT
  • ZSX_Multicharacter
  1. QBCore
  2. ak47_qb_housing

Integration

PreviousConfigurationNextCommands

Last updated 2 months ago

Set Vehicle Fuel

Path: ak47_qb_housing/modules/garage/client/customizable.lua

Give Key

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

Garage Triggers

Path: ak47_qb_housing/modules/garage/client/customizable.lua

PS-MDT

Path: ps-mdt/server/dmb.lua

Replace: GetPlayerProperties

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

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

-- 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