GetPlayerInventory client side, event fires client now
community_bridge:client:inventory:updateInventory
This commit is contained in:
1 parent
651c8ae6df
commit
2a326c4811
14 files changed
+110
-3
No files matched your search
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user