Skip to content

Commit

Permalink
Merge pull request #565 from IamLation/main
Browse files Browse the repository at this point in the history
Add ClearStash export
  • Loading branch information
GhzGarage authored Sep 5, 2024
2 parents 9757648 + a44103e commit f01081d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions server/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,18 @@ end

exports('OpenInventoryById', OpenInventoryById)

-- Clears a given stash of all items inside
--- @param identifier string
function ClearStash(identifier)
if not identifier then return end
local inventory = Inventories[identifier]
if not inventory then return end
inventory.items = {}
MySQL.prepare('UPDATE inventories SET items = ? WHERE identifier = ?', { json.encode(inventory.items), identifier })
end

exports('ClearStash', ClearStash)

--- @param shopData table The data of the shop to create.
function CreateShop(shopData)
if shopData.name then
Expand Down

0 comments on commit f01081d

Please sign in to comment.