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:
MrNewb committed 2025-06-04 15:25:20 -04:00
1 parent 5efcc8ba23
commit 05c80d9d10
9 files changed
+248 -43

No files matched your search

+18 -6
View File
@@ -98,12 +98,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]
@@ -155,6 +149,24 @@ Inventory.CanCarryItem = function(src, item, count)
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 codem-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 codem-inventory, because of this we dont have a way to clear a stash.")
end
---This will update the plate to the vehicle inside the inventory. (It will also update with jg-mechanic if using it)
---@param oldplate string
---@param newplate string