External Shop

Export reference for dynamically creating and accessing shops from external resources.

Create Shop (Server)

Register a new dynamic shop inventory on the server side:

local items = {
    {item = "water", buyPrice = 10, sellPrice = 5, stock = 10}, -- Buy, sell, and stock enabled
    {item = "water", buyPrice = 10, sellPrice = 5},              -- Buy and sell enabled
    {item = "water", buyPrice = 10},                             -- Buy only
    {item = "water", sellPrice = 10},                            -- Sell only
}

exports['ak47_inventory']:CreateShop('shopUniqueId', 'Shop Name', items, 'cash')
Parameter Type Required Description
shopId string Yes Unique shop identifier string
label string Yes Display label in inventory header
items table Yes Array of shop item tables
account string Yes Payment account (cash, bank, black_money)

Open Shop (Client)

Open the registered shop UI for the client:

exports['ak47_inventory']:OpenInventory('shopUniqueId')
Parameter Type Required Description
shopId string Yes Unique shop identifier string