GetPlayerInventory client side, event fires client now

community_bridge:client:inventory:updateInventory
This commit is contained in:
MrNewb committed 2025-02-05 01:54:55 -05:00
1 parent 651c8ae6df
commit 2a326c4811
14 files changed
+110 -3

No files matched your search

+2
View File
@@ -240,6 +240,7 @@ end
-- Adds the specified item to the player's inventory.
Framework.AddItem = function(src, item, amount, slot, metadata)
local player = QBCore.Functions.GetPlayer(src)
TriggerClientEvent("community_bridge:client:inventory:updateInventory", src, {action = "add", item = item, count = amount, slot = slot, metadata = metadata})
return player.Functions.AddItem(item, amount, slot, metadata)
end
@@ -247,6 +248,7 @@ end
-- Removes the specified item from the player's inventory.
Framework.RemoveItem = function(src, item, amount, slot, metadata)
local player = QBCore.Functions.GetPlayer(src)
TriggerClientEvent("community_bridge:client:inventory:updateInventory", src, {action = "remove", item = item, count = amount, slot = slot, metadata = metadata})
return player.Functions.RemoveItem(item, amount, slot or nil)
end