NX Dumpster Diving

Pawn Buyers

Set prices, payout account and buyer locations.

Players sell what they find to a junk buyer ped. Using third eye on the ped and picking Sell Junk opens the NX sell menu. It lists every sellable item the player has, its price and the total value. Players can sell an item, choose an amount, or sell everything at once.

Settings

config.lua
Config.Pawn = {
    account = 'money',
    distance = 2.5,
    prices = { ... },
    locations = { ... },
}
account'money' | 'bank' | 'black_money'default: 'money'
Which ESX account the player is paid into. money is cash.
distancenumberdefault: 2.5
Third eye distance on the buyer ped.

Prices

Only items listed in prices can be sold. The price is per item. Remove an item from the list and the buyer won't take it.

config.lua
prices = {
    crushed_can   = 3,
    empty_chips   = 2,
    trash_bag     = 10,
    moldy_bread   = 2,
    rotten_burger = 4,
    dirty_panties = 15,
    stud_earring  = 75,
    gold_hoops    = 150,
    ak_pendant    = 250,
    gold_watch    = 300,
    hex_watch     = 450,
    gold_ingot    = 1000,
    gold_bar      = 1200,
    diamond       = 1500,
},
ItemDefault price
Crushed Can$3
Empty Chip Bag$2
Bag of Trash$10
Moldy Bread$2
Rotten Burger$4
Dirty Panties$15
Stud Earring$75
Gold Hoop Earrings$150
AK Pendant$250
Gold Watch$300
Hex Watch$450
Gold Ingot$1,000
Gold Bar$1,200
Diamond$1,500

Buyer locations

Add as many buyers as you want. Each one is a separate entry in locations:

config.lua
locations = {
    {
        coords = vec4(-1459.56, -413.73, 35.74, 165.0),
        model = `s_m_m_cntrybar_01`,
        scenario = 'WORLD_HUMAN_SMOKING',
        blip = { enabled = true, sprite = 605, color = 5, scale = 0.7, label = 'Junk Buyer' },
    },
},
coordsvec4
Where the ped stands: vec4(x, y, z, heading). Stand on the spot in game and copy your character's coords and heading. The script lowers the ped by 1.0 so it stands on the ground.
modelhash
Ped model, in backticks.
scenariostring | nil
Idle scenario the ped plays, such as WORLD_HUMAN_SMOKING. Remove it for a ped that just stands.
bliptable
Map blip. Set enabled = false to hide it, which is handy if you want players to find the buyer themselves.

Example: a second, hidden buyer

config.lua
locations = {
    {
        coords = vec4(-1459.56, -413.73, 35.74, 165.0),
        model = `s_m_m_cntrybar_01`,
        scenario = 'WORLD_HUMAN_SMOKING',
        blip = { enabled = true, sprite = 605, color = 5, scale = 0.7, label = 'Junk Buyer' },
    },
    {
        coords = vec4(1211.4, -1389.2, 35.37, 180.0),
        model = `a_m_m_hillbilly_01`,
        blip = { enabled = false },
    },
},

Performance

Buyer peds only spawn when a player is within 60 metres and are removed when they leave, so extra buyers cost nothing when nobody's around.