OrigenNetwork
Docs

Drug Sales · origen_ilegalv2

The drug sales system lets players sell drugs to NPC customers. It supports two independent sale modes that can run simultaneously or be enabled individually.


Sale modes

luaconfig/drug_sales.lua
Config.DrugSales.Modes = {
    ZoneSale = {
        Enable                = true,
        RequireReputation     = false,  -- require street rep to start
        MinReputationToStart  = 90,
    },
 
    ItemSale = {
        Enable = true,
    },
}
ModeTriggerDescription
ZoneSaleGang quick menu (F6)Peds walk TO the player. Only works if the player is in a gang.
ItemSaleUse a drug item from inventoryOpens a menu to sell to a nearby ped or consume the drug. Usable items are registered automatically on server start.

Setting Config.DrugSales.Enable = false disables the entire system regardless of the modes above.


Core settings

luaconfig/drug_sales.lua
Config.DrugSales = {
    Enable             = true,
    CopRequired        = 0,      -- min police online to allow sales
    CopAlertBlipTime   = 200,    -- ms the police alert blip stays on the map
    AllowPoliceToSell  = false,
 
    MaxCustomer               = 30,  -- total customers queued per seller
    MaxSimultaneousCustomers  = 1,
    RejectPercentage          = 20,  -- % chance customer refuses
 
    CustomerSpawnTime       = { min = 3, max = 7 },  -- seconds before next customer
    CustomerInteractionTime = 60,                     -- seconds seller has to interact
 
    UseBlackMoney = true,   -- pay out as dirty money
 
    MinDistanceBetweenSales = 50.0,  -- meters between active sell points
    SaleRadius              = 50.0,  -- active sale area radius around the seller
}

Customer priority queue

Controls the order in which waiting customers are served.

lua
CustomerPriority = {
    enabled               = true,
    distanceThreshold     = 0.5,   -- meters: customers closer are in the "near" group
    priorityByArrival     = true,  -- earlier arrivals get served first
    showWaitingMessages   = true,  -- show queue position messages to waiting customers
    messageUpdateInterval = 0,
    fixedMessages         = true,
},

Customer peds

NPC ped models used as customers. Add/remove entries as needed.

lua
CustomerPeds = {
    's_m_y_doorman_01',
    'a_f_m_tourist_01',
    'a_m_m_eastsa_02',
    'a_m_m_polynesian_01',
    'ig_priest',
    'ig_ramp_hipster',
    'ig_rashcosvki',
    'ig_money',
    'ig_hunter',
},

Police alerts

lua
PoliceAlerts = {
    onReject = true,                                 -- alert when customer rejects
    onAccept = { enabled = true, percentage = 20 },  -- % chance on accept
},
 
PoliceJobs = {
    ['police']  = true,
    ['sheriff'] = true,
    ['sapd']    = true,
},

Street sale settings

Shared settings used by both modes when a ped walks up to the player during a sale.

lua
StreetSale = {
    Enable            = true,   -- legacy guard, modes are controlled via Modes above
    MaxDistance       = 6.0,    -- meters
    CooldownTime      = 5000,   -- ms between attempts (anti-spam)
    OnlyPeds          = true,   -- only NPC peds can buy
    ExcludePlayerPeds = true,   -- exclude player-controlled peds
    IgnoreDeadPeds    = true,   -- skip dead peds as targets
    PriceMultiplier   = 0.8,    -- 80% of the normal drug price
},

Drug list

Define which items are sellable in DrugList. Each entry supports the following fields:

Base fields

FieldTypeDescription
labelstringDisplay name shown in the interaction UI
imagestringOptional image URL or path (used in the admin panel)
quantity{ min, max }Units sold per transaction
price{ min, max }Price per unit in $
propstringWorld prop held during the exchange
rejectChancenumber|nilPer-drug reject % override. Falls back to RejectPercentage if nil
policeChancenumber|nilPer-drug police alert % on accept override
forSalebooleanWhether this drug can be sold to NPCs. Defaults to true
forConsumptionbooleanWhether this drug can be consumed by the player. Defaults to false

effect (consumption only)

Applied when the player consumes the drug. Only used if forConsumption = true.

FieldTypeDescription
typestringEffect type key (see table below)
valuenumber|nilIntensity of the effect (meaning varies per type)
durationnumber|nilDuration in seconds

Available effect types:

KeyDescriptionUses valueUses duration
healRestore value% of max HP✅ (%)
armorAdd value armor points
staminaRestore stamina instantly
heal_fullFull HP + full armor
speedMove speed multiplier✅ (multiplier)
supermanSpeed ×2 + super jump
no_ragdollDisable ragdoll
super_jumpEnable super jump
invincibleGod mode
one_punchMassive melee damage
infinite_staminaInfinite stamina
fireproofFire immunity
screen_highAliens fight post-fx
screen_drunkDrunk shake + blur✅ (0–5 intensity)
blurScreen blur fx
night_visionNight vision

consume (consumption animation)

Controls the animation and progress bar shown when the player consumes the drug.

FieldTypeDescription
animDictstring|nilAnimation dictionary
animClipstring|nilAnimation clip
animFlagnumberAnimation flag (default 49)
progressDurnumber|nilProgress bar duration in seconds
progressLabelstring|nilProgress bar label. Falls back to "Consuming {drug label}"
canMovebooleanAllow movement during consumption (default false)
propModelstring|nilOptional prop held during the animation
propBonenumberPed bone to attach prop to (default 57005 — right hand)
propPos{ x, y, z }Prop position offset
propRot{ x, y, z }Prop rotation offset

Full entry example

luaconfig/drug_sales.lua — DrugList
DrugList = {
    ['packaged_weed'] = {
        label          = 'Gram of Marijuana',
        quantity       = { min = 1, max = 3 },
        price          = { min = 80, max = 150 },
        prop           = 'prop_weed_block_01',
        forSale        = true,
        forConsumption = true,
 
        effect = {
            type     = 'infinite_stamina',
            duration = 30,
        },
 
        consume = {
            animDict      = 'amb@world_human_smoking@male@male1@base',
            animClip      = 'base',
            animFlag      = 49,
            progressDur   = 3,
            progressLabel = 'Smoking...',
            canMove       = true,
        },
    },
 
    ['cokebaggy'] = {
        label    = 'Cocaine Bag',
        quantity = { min = 1, max = 2 },
        price    = { min = 250, max = 400 },
        prop     = 'prop_drug_package_02',
        forSale  = true,
    },
 
    ['meth_bag'] = {
        label    = 'Meth Bag',
        quantity = { min = 1, max = 2 },
        price    = { min = 200, max = 350 },
        prop     = 'prop_drug_package_02',
        forSale  = true,
    },
},

Origin weed packages (by rarity)

Entry-level drug priced lower and tiered by rarity:

lua
['weed_packed_common']    = { label = 'Marijuana Pack (Common)',    quantity = { min = 1, max = 5 }, price = { min = 45,  max = 75  }, prop = 'prop_weed_block_01' },
['weed_packed_uncommon']  = { label = 'Marijuana Pack (Uncommon)',  quantity = { min = 1, max = 4 }, price = { min = 60,  max = 95  }, prop = 'prop_weed_block_01' },
['weed_packed_rare']      = { label = 'Marijuana Pack (Rare)',      quantity = { min = 1, max = 4 }, price = { min = 80,  max = 115 }, prop = 'prop_weed_block_01' },
['weed_packed_epic']      = { label = 'Marijuana Pack (Epic)',      quantity = { min = 1, max = 3 }, price = { min = 95,  max = 130 }, prop = 'prop_weed_block_01' },
['weed_packed_legendary'] = { label = 'Marijuana Pack (Legendary)', quantity = { min = 1, max = 3 }, price = { min = 110, max = 148 }, prop = 'prop_weed_block_01' },

The entire drug list can be managed directly from the admin panel (/gangadmin) without touching any config file. You can create, edit, and delete drugs at runtime — including prices, quantities, effects, and consumption animations. Changes are persisted in origen_drug_sales_custom in the database and merged with the static config on startup. Static entries without a DB override are treated as forSale = true, forConsumption = false by default.


Blacklisted zones

Sales are blocked inside configured zones. Add more entries as needed:

lua
BlacklistedZones = {
    { name = "Police Station", coords = vector3(425.1, -979.5, 30.7),       radius = 100.0 },
    { name = "Hospital",       coords = vector3(298.7, -584.7, 43.2),       radius = 100.0 },
    { name = "Airport",        coords = vector3(-1037.45, -2737.04, 20.17), radius = 400.0 },
},

Customer escape

If the seller ignores a waiting customer, the NPC flees after a timeout.

lua
CustomerEscape = {
    enabled        = true,
    escapeTime     = 20000,                    -- ms before the customer runs
    escapeDistance = { min = 40, max = 60 },   -- meters run before despawn
},

Animations

lua
Animations = {
    phoneCall = {
        enabled    = true,
        duration   = 3000,
        phoneModel = "prop_npc_phone_02",
    },
    exchange = {
        enabled    = true,
        duration   = 3000,
        playerAnim = 'givetake1_a',
        npcAnim    = 'givetake1_b',
    },
},

Blip & messages

lua
BlipSettings = {
    enable = false,   -- show sell point blip on the minimap
},
 
Messages = {
    accepted = 'drug_sales.messages.accepted',
    rejected = 'drug_sales.messages.rejected',
    waiting  = 'drug_sales.messages.waiting',
},

Debug

lua
Debug = {
    enabled              = false,
    showBlacklistedZones = true,
    showSaleRadius       = true,
    markerSettings       = {
        type            = 1,
        scale           = { x = 1.0, y = 1.0, z = 100.0 },
        color           = { r = 255, g = 0,   b = 0, a = 100 },
        colorSaleRadius = { r = 0,   g = 255, b = 0, a = 100 },
    },
},