feat(additemstotrunk & clearstash)
This is very wip, also a good bit of inventories dont support it at all. I have tested this in ox_inventory but not the others. uploading into repo as it does not break anything and may encourage collab
This commit is contained in:
1 parent
5efcc8ba23
commit
05c80d9d10
9 files changed
+248
-43
No files matched your search
@@ -64,12 +64,6 @@ end
|
||||
---This will open the specified stash for the src passed.
|
||||
---@param src number
|
||||
---@param id number||string
|
||||
---@param label string
|
||||
---@param slots number
|
||||
---@param weight number
|
||||
---@param owner string
|
||||
---@param groups table
|
||||
---@param coords table
|
||||
---@return nil
|
||||
Inventory.OpenStash = function(src, id)
|
||||
local stash = Inventory.Stashes[id]
|
||||
@@ -77,8 +71,6 @@ Inventory.OpenStash = function(src, id)
|
||||
TriggerClientEvent('community_bridge:client:jpr-inventory:openStash', src, id, { weight = stash.weight, slots = stash.slots })
|
||||
end
|
||||
|
||||
|
||||
|
||||
---This will register a stash
|
||||
---@param id number||string
|
||||
---@param label string
|
||||
@@ -102,6 +94,24 @@ Inventory.RegisterStash = function(id, label, slots, weight, owner, groups, coor
|
||||
return true
|
||||
end
|
||||
|
||||
---This will add items to a trunk, and return true or false based on success
|
||||
---If a trunk with the identifier does not exist, it will create one with default values.
|
||||
---@param identifier string
|
||||
---@param items table
|
||||
---@return boolean
|
||||
Inventory.AddItemsToTrunk = function(identifier, items)
|
||||
if type(items) ~= "table" then return false end
|
||||
return false, print("AddItemsToTrunk is not implemented in jpr-inventory, because of this we dont have a way to add items to a trunk.")
|
||||
end
|
||||
|
||||
---This will clear the specified inventory, will always return true unless a value isnt passed correctly.
|
||||
---@param id string
|
||||
---@return boolean
|
||||
Inventory.ClearStash = function(id, _type)
|
||||
if type(id) ~= "string" then return false end
|
||||
return false, print("ClearInventory is not implemented in jpr-inventory, because of this we dont have a way to clear a stash.")
|
||||
end
|
||||
|
||||
---This will return a boolean if the player has the item.
|
||||
---@param src number
|
||||
---@param item string
|
||||
|
||||
Reference in new issue
Block a user