From b9f5a3ed6445865158d15f5e7504827b2eb686ba Mon Sep 17 00:00:00 2001 From: gononono64 <96976330+gononono64@users.noreply.github.com> Date: Sat, 24 May 2025 15:36:05 -0500 Subject: [PATCH] Small fix for client entities and qb stashes and shops Shops: aligned format with others and removed the instant open (on create) Stashes: Updated for new version of qb (exports) Entities: returning point object --- lib/entities/client/client_entity.lua | 2 +- modules/inventory/qb-inventory/server.lua | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/entities/client/client_entity.lua b/lib/entities/client/client_entity.lua index 63c52af..33adce7 100644 --- a/lib/entities/client/client_entity.lua +++ b/lib/entities/client/client_entity.lua @@ -74,7 +74,7 @@ function ClientEntity.Register(entityData) -- Use Point system for proximity checks -- print(string.format("[ClientEntity] Registering entity %s at %s", entityData.id, json.encode(entityData))) - Point.Register(entityData.id, entityData.coords, entityData.spawnDistance or 50.0, entityData, SpawnEntity, RemoveEntity, function() end) + return Point.Register(entityData.id, entityData.coords, entityData.spawnDistance or 50.0, entityData, SpawnEntity, RemoveEntity, function() end) end --- Unregisters an entity and removes it from the world if spawned. diff --git a/modules/inventory/qb-inventory/server.lua b/modules/inventory/qb-inventory/server.lua index 6de16e3..73f45ca 100644 --- a/modules/inventory/qb-inventory/server.lua +++ b/modules/inventory/qb-inventory/server.lua @@ -90,6 +90,10 @@ Inventory.OpenStash = function(src, id) local stash = Inventory.Stashes[id] assert(stash, "Stash not found", id) + if getInventoryNewVersion() then + return exports['qb-inventory']:OpenInventory(src, id) + end + TriggerClientEvent('community_bridge:client:qb-inventory:openStash', src, id, { weight = stash.weight, slots = stash.slots}) end @@ -192,8 +196,8 @@ end -- @param shopInventory table -- @param shopCoords table -- @param shopGroups table -Inventory.CreateShop = function(src, shopTitle, shopInventory, shopCoords, shopGroups) - if not shopTitle or not shopInventory or not shopCoords then return end +Inventory.CreateShop = function(shopTitle, shopInventory, shopCoords, shopGroups) + if not shopTitle or not shopInventory then return end if registeredShops[shopTitle] then return true end registeredShops[shopTitle] = true local newVersion = getInventoryNewVersion() @@ -212,7 +216,7 @@ Inventory.CreateShop = function(src, shopTitle, shopInventory, shopCoords, shopG end shopData.slots = #shopData.items - TriggerClientEvent("inventory:client:OpenInventory", src, "shop", shopTitle, shopData) + -- TriggerClientEvent("inventory:client:OpenInventory", src, "shop", shopTitle, shopData) v1ShopData[shopTitle] = shopData print("QB-INVENTORY: You are using an outdated version of qb-inventory, please update to the latest version. Stuff will still work but you are using litterally the most exploitable inventory in fivem.") end