Studios
Drug Saleshouse-3.jpg

Examples

SoonDrug SalesQbox
PAGE 04 OF 07  ·  CONFIGURATION → EXAMPLES → TROUBLESHOOTINGdocs.glitchstudios.dev
Browse docs

A quiet low-population server#

Sell with nobody on duty, fewer refusals and slower saturation:

-- profile/shared/myserver.lua
Config.Corner.minPolice = 0
Config.Corner.refuseChance = 0.25
Config.Saturation.dropPerSale = 0.02
Config.Undercover.chance = 0.02

Add a drug to corner selling#

Add the item to ox_inventory first, then to Config.Drugs. A drug without purity sells at a random price inside its range. Deals customers can order it too:

Config.Drugs['oxy'] = { price = { 90, 130 }, amount = { 1, 2 }, kind = 'pills' }

Move the Cousin#

Config.Cousin.base = vec4(1985.6, 3050.1, 47.2, 240.0)
Config.Cousin.areaName = 'Route 68'
Config.Cousin.meets = {
    vec4(1394.6, 3613.9, 34.98, 200.0),
    vec4(2342.0, 3051.4, 48.15, 95.0),
}

Record a sale from another resource#

A resource that sells drugs its own way (a brick buyer, for example) can add the sale to the player's total and to their daily tablet REP:

-- server
exports['glitch-drugSales']:RecordSale(source, 4500, 'brick')

Read a player's sales total#

-- server
local total = exports['glitch-drugSales']:GetDrugSales(source)
if total >= 100000 then
    -- unlock something
end

Send a Cousin hint#

Call it when a player first cooks meth. It sends once per player, and never to someone who has met him:

-- server
exports['glitch-drugSales']:CousinHint(source, 'cook')

Show today's gummy trend#

-- server
local trend = exports['glitch-drugSales']:GetGummyTrend()
print(('Hot: %s, cold: %s'):format(trend.hot or '-', trend.cold or '-'))