Merchants
Config

Config

cl_config.lua

You can change the Scroll from x to y to make the UI scroll on the Y axis

-- ❗ CLIENT NOTIFICATION ❗
Config.Notification = function(title, message, type, time)
    Framework.Notify(message, type, time)
end
 
-- ❗ MERCHANT UI SCROLL ❗
Config.Scroll = 'x'

sh_config.lua

⚠️

Target Interaction Only Load On Spawn

ℹ️

You can Turn On Debug To Preload Targets Without Having To Spawn Each Time, Make Sure To Turn It Off When Done.

Config = {}
 
-- ❗ MERCHANT DEBUG ❗
Config.Debug = true
 
-- ❗ MERCHANT PATH DEBUG ❗
Config.PathDebug = false
 
-- ❗ MERCHANT CREATION TOOL ❗
Config.CreationTool = true
 
-- ❗ INVENTORY PATH FOR IMAGES ❗
Config.Inventory = 'qb-inventory/html/images/'
 
-- ⚠️ DON'T TOUCH ⚠️
Config.Merchants = {}

sv_config.lua

-- ⚠️ DON'T TOUCH ⚠️
Config.Currencies = {}
 
-- ❗ EXAMPLE MERCHANTS ❗
Config.Examples = true
 
-- ❗ SERVER NOTIFICATION ❗
Config.Notification = function(src, title, message, type, time)
    Framework.Notify(src, message, type, time)
end
 
-- ❗ DISCORD WEBHOOK LOGGING ❗
Config.Discord = {
    ['open'] = '',
    ['buy'] = '',
    ['sell'] = '',
    ['market_buy'] = '',
    ['market_sell'] = '',
    ['market_collect'] = '',
}

sv_currencies.lua

-- ❗ CURRENCY: CASH ❗
Config.Currencies['cash'] = {
    label = '${amount}',
    check = function(src, data)
        local Player = Framework.GetPlayer(src)
        local cash = Player.GetMoney('cash')
        return cash >= data.amount
    end,
    remove = function(src, data)
        local Player = Framework.GetPlayer(src)
        return Player.RemoveMoney('cash', data.amount)
    end,
    add = function(src, data)
        local Player = Framework.GetPlayer(src)
        return Player.AddMoney('cash', data.amount)
    end,
}
 
-- ❗ CURRENCY: BANK ❗
Config.Currencies['bank'] = {
    label = '${amount}',
    check = function(src, data)
        local Player = Framework.GetPlayer(src)
        local bank = Player.GetMoney('bank')
        return bank >= data.amount
    end,
    remove = function(src, data)
        local Player = Framework.GetPlayer(src)
        return Player.RemoveMoney('bank', data.amount)
    end,
    add = function(src, data)
        local Player = Framework.GetPlayer(src)
        return Player.AddMoney('bank', data.amount)
    end,
}
 
-- ❗ CURRENCY: ITEM ❗
Config.Currencies['item'] = {
    label = '{amount}x {item}',
    check = function(src, data)
        return Framework.GetItemCount(src, data.item) >= data.amount
    end,
    remove = function(src, data)
        return Framework.RemoveItem(src, data.item, data.amount)
    end,
    add = function(src, data)
        return Framework.AddItem(src, data.item, data.amount)
    end,
}