Configuration Reference

Reference for the shipped configuration files and pricing definitions in Oxide Drugselling.

Reference for the shipped config files in oxide-drugselling.

shared/config.lua

Debug

SettingTypeDefaultDescription
Config.DebugbooleanfalseEnables debug logging for sale flow, inventory grouping, pricing, and export fallbacks.
Config.Debug = false

Dirty Money

SettingTypeDefaultDescription
Config.DirtyMoney.modestring'account''account' uses o-link.money; 'item' uses o-link.inventory.
Config.DirtyMoney.accountstring'cash'Account name used in account mode.
Config.DirtyMoney.itemstring'black_money'Item name used in item mode.
Config.DirtyMoney = {
    mode = 'account',
    account = 'cash',
    item = 'black_money',
}

shared/config/selling.lua

General

SettingTypeDefaultDescription
Config.Selling.enabledbooleantrueMaster toggle for the selling system.
Config.Selling.targetIconstring'fas fa-hand-holding-dollar'Icon sent to the configured o-link target backend.
Config.Selling.targetLabelstring'sell_offer_drugs'Locale key used as the interaction label.
Config.Selling.targetDistancenumber5.0Interaction distance.
Config.Selling.panelTitlestring'Street Sale'Title shown in the sell panel.
Config.Selling = {
    enabled = true,
    targetIcon = 'fas fa-hand-holding-dollar',
    targetLabel = 'sell_offer_drugs',
    targetDistance = 5.0,
    panelTitle = 'Street Sale',
}

Cooldowns

SettingTypeDefaultDescription
Config.Selling.cooldownnumber5000Player cooldown after cleanup of any interaction.
Config.Selling.npcCooldownnumber120000Cooldown applied to the NPC location key.

Police

SettingTypeDefaultDescription
Config.Selling.policeJobstable{ 'police', 'sheriff' }Job names counted through o-link.job.GetPlayersWithJob.
Config.Selling.minPoliceOnlinenumber0Minimum online police count required to sell.

Pricing

SettingTypeDefaultDescription
Config.Selling.pricing.autoAcceptMaxnumber0.90Auto-accept threshold ratio.
Config.Selling.pricing.negotiateMaxnumber1.25Maximum ratio that can still negotiate instead of rejecting.
Config.Selling.pricing.counterOffernumber0.95Counter-offer fraction of fair total price.
pricing = {
    autoAcceptMax = 0.90,
    negotiateMax = 1.25,
    counterOffer = 0.95,
}

Risks

SettingTypeDefaultDescription
Config.Selling.risks.policeCallChancenumber0.15Chance to dispatch police on any interaction.
Config.Selling.risks.rejectChancenumber0.15Flat rejection chance before price logic.
Config.Selling.risks.robberyChancenumber0.15Robbery chance for gang NPCs only.
Config.Selling.risks.robberyItemLossnumber3Maximum items stolen from the offered stack.
Config.Selling.risks.robberyCashPercentnumber0.25Percent of current dirty-money balance stolen.
risks = {
    policeCallChance = 0.15,
    rejectChance = 0.15,
    robberyChance = 0.15,
    robberyItemLoss = 3,
    robberyCashPercent = 0.25,
}

Dispatch

SettingTypeDefaultDescription
Config.Selling.dispatch.codestring'10-31'Alert code sent through o-link.dispatch.
Config.Selling.dispatch.messagestring'sell_dispatch_message'Locale key for the dispatch message.
Config.Selling.dispatch.blipData.spritenumber469Map blip sprite.
Config.Selling.dispatch.blipData.colornumber1Map blip color.
Config.Selling.dispatch.blipData.scalenumber0.8Map blip scale.
Config.Selling.dispatch.timenumber60000Alert duration in milliseconds.
dispatch = {
    code = '10-31',
    message = 'sell_dispatch_message',
    blipData = { sprite = 469, color = 1, scale = 0.8 },
    time = 60000,
}

Ped Model Lists

blacklistedModels defines models that can never be used for selling.

gangModels defines models that can roll the robbery outcome and display the dangerous-state UI.

Both lists use GTA model hashes in backtick notation:

blacklistedModels = {
    `s_m_y_cop_01`, `s_f_y_cop_01`, `s_m_y_sheriff_01`,
    `s_m_y_ranger_01`, `s_m_y_marine_01`, `s_m_y_marine_02`,
    `s_m_y_marine_03`, `s_m_m_paramedic_01`, `s_m_m_security_01`,
    `csb_cop`,
}
gangModels = {
    `g_m_y_famca_01`, `g_m_y_famdnf_01`, `g_m_y_famfor_01`,
    `g_m_y_ballaorig_01`, `g_m_y_ballaeast_01`, `g_m_y_ballasout_01`,
    `g_m_y_lost_01`, `g_m_y_lost_02`, `g_m_y_lost_03`,
    `g_m_y_mexgang_01`, `g_m_y_mexgoon_01`, `g_m_y_mexgoon_02`,
    `g_m_y_salvaboss_01`, `g_m_y_salvagoon_01`,
    `g_m_y_korean_01`, `g_m_y_korean_02`,
}

Camera

SettingTypeDefaultDescription
Config.Selling.camera.interpTimenumber500Camera transition time.
Config.Selling.camera.distancenumber1.8Forward offset from the NPC.
Config.Selling.camera.heightOffsetnumber0.3Vertical camera offset.
Config.Selling.camera.fovnumber50.0Camera field of view.

Animations

Each animation entry has dict, clip, and duration.

anims = {
    npcThinking = { dict = 'amb@world_human_smoking@male@male_a@enter', clip = 'enter', duration = 2000 },
    npcAccept = { dict = 'mp_common', clip = 'givetake1_a', duration = 1800 },
    npcReject = { dict = 'gestures@m@standing@casual', clip = 'gesture_no_way', duration = 1000 },
}

shared/config/drugs.lua

This file defines every sellable drug type. The shipped config includes weed and meth.

Drug Type Shape

Config.Drugs.drugkey = {
    label = 'Display Name',
    items = { ... },
    metaKeyFormat = '{field1}:{field2}',
    groupLabel = 'metadata_field',
    gradeDisplay = { ... },
    progression = { ... },
    requiredLevel = 0,
    modifiers = { ... },
}

Items

items maps item names to display labels and base prices. Only configured items are sellable.

items = {
    weed_1g = { label = 'Weed (1g)', basePrice = 25 },
    weed_eighth = { label = 'Weed (1/8 oz)', basePrice = 75 },
}

Metadata Grouping

metaKeyFormat controls how stacks are grouped. The format string is resolved by replacing {field} tokens with values from item metadata through BuildMetaKey.

Examples from the shipped config:

  • weed: '{strain_id}:{quality}'
  • meth: '{variant}:{purity}'

groupLabel defines which metadata field is shown as the primary label for a group.

Examples:

  • weed: strain_name
  • meth: variant_name

Grade Display

gradeDisplay controls how grades are shown in the panel.

FieldPurpose
gradeMetaMetadata field containing the textual grade
scoreMetaOptional numeric score field shown in the panel
colorsTailwind classes keyed by grade

Shipped examples:

  • weed uses quality + quality_score
  • meth uses purity and no score field

Progression

progression is optional.

SettingDescription
resourceResource name to call exports on
levelExportExport used to fetch player level
addXpExportExport used to award XP
addSoldExportExport used to track sold units
xpPerUnitXP multiplier per sold unit

requiredLevel applies only when the source resource is running and the level export succeeds. If the resource is not started, the sale is allowed and tracking is skipped.

Modifiers

modifiers is an ordered array. Each modifier contributes either a multiplier or a bonus.

Required base fields:

SettingDescription
typeModifier type
category'multiplier' or 'bonus'

Supported shipped modifier types:

  • score_multiplier
  • grade_multiplier
  • variant_multiplier
  • trait_bonus
  • metadata_bonus

Configuration Strategy

Start by aligning these three areas with your server:

  1. Config.DirtyMoney for payout behavior
  2. Config.Selling for interaction, police, and risk behavior
  3. Config.Drugs for your actual item names, metadata shape, and source resource integrations

Next Steps