Shops

shops.lua

This module provides functions to open, sell to, and register in-game shops and markets.

sellMenu(data)

Opens a UI menu for selling items to a vendor or market system.

A simple system for the ability to sell all of an item in a players inventory

Good for money making eg. pawn shops

Example:

sellMenu({
    sellTable = {
        Header = "Sell Items",
        Items = {
            ["gold_ring"] = 100,
            ["diamond"] = 500,
        },
    },
    ped = pedEntity,
    onBack = function() print("Returning to previous menu") end,
})

sellAnim(data)

Plays an animation during the selling process for immersion.

Used in sellMenu, but can be called externally if needed

Example:


openShop(data)

Opens a shop interface for purchasing items.

Checks job/gang restrictions, then uses the active inventory system to open the shop.

Example:


registerShop(name, label, items, society)

Registers a named shop with associated items and an optional society for fund handling.

Supports either OXInv or QBInv (with QBInvNew flag).

Example:


Last updated