From 5aa2d5c8ed57d21b72b681e8813797ad2a4c134f Mon Sep 17 00:00:00 2001 From: Friskky Date: Sun, 29 Jun 2025 14:01:01 -0700 Subject: [PATCH] Better QBox Support --- client/main.lua | 18 ++++++++++++++++-- config/client.lua | 3 +++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index cf83d13..e96a7e1 100644 --- a/client/main.lua +++ b/client/main.lua @@ -228,8 +228,17 @@ local function createCharacter(cid, character) birthdate = character.birthdate, cid = cid }) + + if GetResourceState('qbx_spawn') == 'missing' then + spawnDefault() + else + if config.qbx_properties then + TriggerEvent('apartments:client:setupSpawnUI', newData) + else + TriggerEvent('qbx_core:client:spawnNoApartments') + end + end - spawnDefault() destroyPreviewCam() return true end @@ -277,7 +286,12 @@ RegisterNuiCallback('playCharacter', function(data, cb) SetNuiFocus(false, false) DoScreenFadeOut(10) lib.callback.await('bub-multichar:server:loadCharacter', false, data.citizenid) - spawnLastLocation() + if config.spawnlastlocation then + spawnLastLocation() + else + TriggerEvent('qb-spawn:client:setupSpawns', data.citizenid) + TriggerEvent('qb-spawn:client:openUI', true) + end destroyPreviewCam() cb(1) end) diff --git a/config/client.lua b/config/client.lua index 6ae792d..ec4e598 100644 --- a/config/client.lua +++ b/config/client.lua @@ -2,6 +2,9 @@ return { loadingModelsTimeout = 10000, -- Waiting time for ox_lib to load the models before throws an error, for low specs pc defaultAllowedCharacters = 4, -- The amount of characters you can have in total + qbx_properties = true, -- used to ensure that you get a starting apartment from qbx_properties + spawnlastlocation = false, -- change to true if you ALWAYS want to spawn at last location + characters = { locations = { -- Spawn locations for multichar, these are chosen randomly {