Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qbox #505

Closed
Something684 opened this issue Dec 8, 2024 · 1 comment
Closed

qbox #505

Something684 opened this issue Dec 8, 2024 · 1 comment

Comments

@Something684
Copy link

using qbox

06:45:17 [ script:qbx_core] SCRIPT ERROR: citizen:/scripting/lua/scheduler.lua:749: SCRIPT ERROR: @ps-mdt/server/dbm.lua:64: ps-mdt was unable to execute a query!
06:45:17 [ script:qbx_core] Query: SELECT houselocations.label, houselocations.coords FROM player_houses INNER JOIN houselocations ON player_houses.house = houselocations.name where player_houses.citizenid = ?
06:45:17 [ script:qbx_core] ["VIVJ6WV7"]
06:45:17 [ script:qbx_core] Unknown column 'houselocations.label' in 'field list'

when trying to open a profile

@subhampro
Copy link

subhampro commented Dec 9, 2024

Based on the error message, it looks like there's an issue with the database query in ps-mdt when trying to fetch property information. The error occurs because the houselocations table doesn't have a label column as expected

I can help you to fix this ! Since you're using QBox, the housing system likely has a different database structure than what ps-mdt expects. You'll need to modify the query in server/dbm.lua to match your housing system's database schema.

Open dbm.lua and locate this function:

function GetPlayerProperties(cid, cb)
    local result = MySQL.query.await('SELECT houselocations.label, houselocations.coords FROM player_houses INNER JOIN houselocations ON player_houses.house = houselocations.name where player_houses.citizenid = ?', {cid})
    return result
end

You'll need to modify this to match your housing system's database structure. Try one of these approaches:

-- Option 1: If using qb-houses

function GetPlayerProperties(cid, cb)
    local result = MySQL.query.await('SELECT house, label FROM player_houses WHERE citizenid = ?', {cid})
    return result
end

-- Option 2: If not using housing system

function GetPlayerProperties(cid, cb)
    return {} -- Return empty array if housing not implemented
end

You may also want to disable housing features in the config. Open shared/config.lua and set:

Config.UsingPsHousing = false
Config.UsingDefaultQBApartments = false

This should resolve the database error and allow the MDT to function properly with QBox, though without housing information until you implement the correct database queries for your specific housing system.

@xFutte xFutte closed this as completed Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants