Skip to content

Configuration ​

Everything is in shared/config/, one numbered file per area. All of them are shared (client and server), so nothing secret goes in there. Money is whole dollars, distances are metres measured in 3D. Numbers that appear in the screenshots (prices, distances, percentages) are defaults, not rules.

Staff change the spacing rules, limits, fees and zones live in /vendingadmin (stored in the database on top of these files) and can export them back as a config.lua snippet. With np_admin running, the main tunables are also on its Resource settings page under Vending machines (see Editable in np_admin).

File What
00_core.lua Locale, currency, bridges, staff without np_admin, which np_* siblings to use, RPC rate limit, ledger retention
10_models.lua Machine models: props, family, grid, capacity, price, cash box, allowed items, licence, per-model spacing
11_items.lua Stock items (price limits, effects, age) and np_vending's own items
12_spacing.lua Spacing rules, limits, permit fee, placement
13_zones.lua Zones: placement allowed / staff / off, machine cap, rent, traffic, spacing overrides
14_world.lua City-owned map machines: stock, restock, price
15_economy.lua Purchase, pay methods, stamps, tray, jams, drink now, cash box, rent, market, companies, keys, upgrades, routes, jobs, wholesale
16_crime.lua Break-ins, vandalism, skimming, police
17_ui.lua Stream distance, keys, commands, np_menu options, blips, drink animations, the phone app, alerts
18_shops.lua Shop entrances for the shop spacing rule

Core (00_core.lua) ​

Option Default Description
Config.Debug false Debug output
Config.Locale 'en' 'en' or 'de', for server texts and the NUI
Config.Currency { symbol = '$', code = 'USD' } Currency in texts and the UI
Config.Framework 'auto' 'esx', 'qbx', 'qb', 'standalone', or auto-detect (esx → qbx → qb → standalone)
Config.Inventory 'auto' 'np' (np_inventory), 'ox', 'qb', 'none', or auto-detect (np first)
Config.Admins {} Staff without np_admin: FiveM identifiers ('license:…', 'discord:…')
Config.AdminGroups { esx = { 'admin', 'superadmin' }, qb = { 'admin', 'god' } } Staff without np_admin: ESX groups and qb-core / qbx_core permissions
Config.AdminDiscordRoles {} Staff without np_admin: np_discord role ids or role names
Config.AdminDiscordCacheSeconds 60 How long a Discord role answer is cached
Config.Integrations every sibling 'auto' np_inventory, np_hud, np_phone, np_payments, np_identification, np_gangs, np_discord, np_menu, np_character, np_shops, np_drugs. 'auto' = used while started, false = never (the fallback runs). See Bridges & integrations
Config.Rpc { perSecond = 8, burst = 20 } Token bucket per player over every RPC
Config.Timers { tickSeconds = 5 } How often the scheduler (auctions, rent, jobs) runs
Config.LedgerKeepDays 45 Ledger rows older than this are pruned

Models (10_models.lua) ​

lua
Config.Models.sprunk = {
  label = 'Sprunk soda', props = { 'prop_vend_soda_02' }, family = 'soda', icon = 'bottle-water', tint = 'green',
  rows = 3, cols = 4, capacity = 12, price = 8500, cashMax = 1500,
  items = { 'sprunk', 'sprunk_light', 'ecola', 'ecola_light', 'orang_o_tang', 'raine_water', 'junk_energy' },
}
Field Description
label, icon, tint Name and tile of the model
props Prop models. The first one is spawned for player machines; every prop of the list is recognised as a city machine of this model on the map
family Spacing "same type": two machines of one family from different operators fall under sameTypeOther
rows, cols The slot grid (codes A1 …)
capacity Items per slot (one coil)
price Price of a new machine (placement without a crate)
cashMax Cash box size. A full box stops cash sales
items Items this model may hold
license np_identification document type the owner needs to place or buy one (nil = none)
capsule Gumball / capsule machine: slots hold a mix, the buyer gets one at random
spacing Per-model overrides of Config.Spacing (sameOwner, otherOwner, sameTypeOther, worldMachine, shop)
note, indoor Hints in the placement picker (needs_water, indoor)
Model Props Grid Capacity Price Cash box Notes
sprunk prop_vend_soda_02 3 × 4 12 $8,500 $1,500
ecola prop_vend_soda_01 3 × 4 12 $8,500 $1,500
candybox prop_vend_snak_01, _tu 4 × 4 10 $7,200 $1,500
coffee prop_vend_coffe_01 2 × 3 20 $9,800 $1,200
water prop_vend_water_01, prop_watercooler, prop_watercooler_dark 1 × 1 40 $2,100 $600 Spacing 5 / 10 / 10 m, indoor
cigarettes prop_vend_fags_01 2 × 3 10 $6,400 $2,000 Owner needs business_license
gumball prop_gumball_01 … _03 1 × 1 30 $900 $400 Capsule, sameOwner 5 m

Config.ModelOrder sets the order in the placement picker.

Items (11_items.lua) ​

Config.Items[name] describes a stock item: the slot tile and its default price. The inventory item must exist (see Items).

Field Description
label, icon, tint, weight Tile, and the np_inventory definition (weight in grams)
price Default price of a new slot
floor, ceiling Price limits the owner can't leave (nil = none)
effect What Drink now applies: { thirst, hunger, stress } in points 0..100
anim 'can', 'bottle', 'bar', 'coffee' or nil: the Drink now animation
minAge Buyers must be this old (shipped: redwood, debonaire = 18)
wholesale What one unit is worth when a listing without stock is sold (default price / 2)
Option Default Description
Config.ItemNames crate = 'vending_crate', deed = 'vending_deed', key = 'vending_key', tablet = 'vending_tablet', crowbar = 'crowbar', repairKit = 'vending_repairkit', skimmer = 'vending_skimmer' np_vending's own items. false switches a feature off (no crate: machines are bought in placement mode only; no deed: ownership is not an item …)
Config.RegisterItems true Register missing items in np_inventory at start
Config.ToolItems crate, deed, key, tablet, repair kit, skimmer, crowbar Definitions registered in np_inventory (label, weight, stack, icon, tint, description)

Spacing rules (12_spacing.lua) ​

The minimum distance between machines, measured in 3D. 0 switches a rule off.

lua
Config.Spacing = {
  sameOwner = 25.0,        -- between two machines of one operator
  otherOwner = 60.0,       -- to a machine of another operator
  sameTypeOther = 90.0,    -- same model family (soda / snacks / ...), different operators
  worldMachine = 15.0,     -- city-owned machines (map props nobody has bought yet)
  shop = 40.0,             -- shop entrances (Config.Shops and np_shops)
  groupCountsAsOwner = true,
  tighten = 'flag',
  models = {},             -- { water = { sameOwner = 5.0 } }
}
Option Default Description
sameOwner 25 Between two machines of one operator
otherOwner 60 To a machine of another operator
sameTypeOther 90 Same model family, different operators (two soda machines compete harder than soda and snacks)
worldMachine 15 To city-owned map machines nobody has bought yet
shop 40 To a shop entrance (Config.Shops, plus np_shops when it offers GetShops)
groupCountsAsOwner true Machines of your company (job) or np_gangs gang count as "same operator", so members share the short distance
tighten 'flag' A stricter rule never removes existing machines. 'flag' lists those that now break it in the staff view, 'keep' doesn't
models {} Per-model overrides on top of Config.Models[*].spacing

How a pair is checked. Every machine has its own numbers: the global rule, replaced by the zone it stands in, replaced by its model's override. For each nearby machine the engine picks the rule that applies (same operator, other operator, city machine; a rival of the same family is checked against otherOwner and sameTypeOther) and needs the larger number of the two machines. Unregistered map props count as city machines. The client draws the result as rings, and the server runs the same code again before anything is placed, bought or moved.

Option Default Description
Config.Limits.perPlayer 10 Machines one player owns (0 = no limit)
Config.Limits.perCompany 25 Machines one company (job) or gang owns
Config.Limits.permitFee 1200 Placement permit, due again when a machine is moved
Config.Placement.enabled true Players may place machines
Config.Placement.maxDistance 8.0 The spot may be this far from the player (server check)
Config.Placement.pickupRefund 60 % of the machine price paid back when an inventory without metadata can't hold a crate
Config.Placement.firstRentWeek true The first week of spot rent is due when the machine is placed

Zones (13_zones.lua) ​

Polygons (x / y, the height doesn't matter) with their own rules. Staff edit them in /vendingadmin.

lua
Config.Zones.vespucci_boardwalk = {
  label = 'Vespucci Boardwalk', placement = 'allowed', maxMachines = 12, rent = 350, traffic = 3,
  spacing = { sameOwner = 10.0, otherOwner = 30.0, sameTypeOther = 45.0 },
  points = { { x = -1850.0, y = -1250.0 }, { x = -1650.0, y = -1060.0 }, { x = -1500.0, y = -1180.0 }, { x = -1700.0, y = -1380.0 } },
}
Field Description
label Name in the UI
points At least three { x, y } corners
placement 'allowed', 'staff' (only staff may place) or 'off' (nobody)
maxMachines Player machines in the zone (nil = no limit)
rent Weekly spot rent in the zone (else Config.Economy.rent.byTraffic)
traffic Foot traffic 1..3: drives the rent, the sales estimate and the city price
spacing Overrides of Config.Spacing inside the zone: sameOwner, otherOwner, sameTypeOther, worldMachine, shop
Shipped zone Placement Max Rent / week Traffic Same op. / other op. / same type
vespucci_boardwalk allowed 12 $350 3 10 / 30 / 45 m
legion_square allowed 8 $500 3 15 / 40 / 60 m
blaine_county allowed – $90 1 25 / 120 / 200 m
mission_row_pd staff 2 – – –
pillbox_er staff 2 – – –

World machines (14_world.lua) ​

Every vending prop on the map (Config.Models[*].props) is a city-owned machine. It has no database row until somebody first walks up to it.

Option Default Description
enabled true Map props are machines at all
cityStocked true The city keeps its machines full. false: empty until bought
restockMinutes 60 City machines refill this often
purchasable true City machines can be bought at the machine
price sprunk = 18500, ecola = 18500, candybox = 15500, coffee = 21000, water = 4500, cigarettes = 14000, gumball = 2400 City price per model
priceByTraffic { 0.8, 1.0, 1.25 } Factor on the price per traffic level 1..3
scanRadius 2.0 Client: props within this distance are offered
dedupe 1.5 Two claims of one model within this distance are the same machine
minGap 0.8 A claim of another model closer than this to a machine is refused
claimsPerHour 15 New city machines one player may register per hour. The server can't see map props, so a claim is the client's word
claimBreakInMinutes 30 A freshly registered city machine can't be pried open for this long
fill 1.0 Stock of a city machine: every slot gets the model's items in order, fill × capacity
ignore {} Spots that are no vending machine on this server: { x, y, z, radius } (e.g. decorative props in an MLO)

Economy (15_economy.lua) ​

Purchase and payment ​

Option Default Description
Config.Purchase.maxQty 5 Items per purchase
Config.Purchase.useDistance 3.0 The buyer stands this close (server check)
Config.Purchase.againSeconds 600 Same again remembers the last purchase at a machine this long
Config.Payments.cash.enabled true Framework cash, into the machine's cash box
Config.Payments.card.enabled true np_payments QuickPay (bank / cards, the player confirms), else the framework bank
Config.Payments.phone.enabled true Phone tap: np_payments Charge('bank') without a sheet, else the framework bank
Config.Payments.phone.requirePhone false The player must carry a phone item (np_phone requireItem / itemNames) when np_phone runs
Config.Payments.merchantIcon 'cookie-bite' Icon of the merchant in the np_payments sheet when the machine has none
Config.Stamps { enabled = true, every = 10 } Every 10th item at one operator is free
Config.Tray.seconds 120 Items that didn't fit wait this long in the tray
Config.DrinkNow.enabled true The Drink now button

The pay switches here are server-wide; owners switch each method per machine on top.

Jams ​

Option Default Description
enabled true Jams at all
chance 3 % per purchase that one item gets stuck
shakeChance 55 % per shake that it falls
shakeCooldownMs 1500 Time between shakes
holdMs 2500 Hold E this long to shake
seconds 300 A jam is forgotten after this (a refund is possible until then)

Cash box, cards and traffic ​

Option Default Description
Config.Economy.cashBox { default = 1500, alertPercent = 80 } Box size when the model has no cashMax; the owner is alerted from 80 %
Config.Economy.cardSettleMinutes 60 Card and phone sales go to the operator's account this often
Config.Economy.traffic.default 2 Traffic of spots outside every zone
Config.Economy.estimate { 120, 260, 420 } Estimated sales per day by traffic 1..3 (placement card)
Config.Economy.rivalRadius 150.0 Rivals counted on the placement card
Config.Economy.lowStockPercent 25 A slot below this is "low"

Rent ​

Option Default Description
Config.Economy.rent.enabled true Weekly spot rent
rent.byTraffic { 90, 200, 350 } Rent per week by traffic when the zone has none
rent.periodDays 7 Rent period
rent.graceDays 3 Unpaid this long after the due date: the machine returns to the city
rent.autoPay true Due rent is taken from the company / gang balance, or the owner's bank while they are online
rent.remindHours 24 Owners are reminded this long before the due date

See Market, auctions & rent.

Market ​

Option Default Description
enabled true The marketplace
minPrice 100 Lowest listing price
auctionHours { 2, 72 } Allowed auction lengths for owner listings
auctionDefaultHours 24 Default auction length
minIncrement 50 A bid beats the current one by at least this
cityAuctionTraffic 3 Machines that return to the city on a spot with this traffic go to auction
cityAuctionHours 24 Length of a city auction
cityAuctionStart 0.5 Start bid as a share of the city price
cityPrice 1.0 Other returned machines are listed at this share of the city price

Companies and gangs ​

lua
Config.Business = {
  jobs = {
    -- vending = { label = 'Coastal Vending Co.', ownerGrade = 3, account = 'internal' },
  },
  anyJob = false,
  defaultOwnerGrade = 3,
  memberPerms = { restock = true, collect = false, price = false },
  gangs = true,
  gangOwnerRanks = { og = true, trusted = true },
  gangMemberPerms = { restock = true, collect = true, price = false },
}
Option Description
jobs[job] A job that may own machines (operator job:<name>): label, ownerGrade (this grade and above act as owner: buy, place, prices, keys, money), account
jobs[job].account 'society': money goes to the job's society account (esx_addonaccount, qb-management / qb-banking / Renewed-Banking). 'internal': np_vending keeps the balance itself (dashboard, withdraw)
anyJob true: every job can run machines, with defaultOwnerGrade (3)
memberPerms Rights of employees below the owner grade
gangs np_gangs gangs run machines (operator gang:<id>)
gangOwnerRanks Gang ranks that act as owner (og, trusted)
gangMemberPerms Rights of the other gang members

Keys and upgrades ​

Option Default Description
Config.Keys.giveItem true The key holder also gets a vending_key item (inventories with metadata)
Config.Keys.requireItem false A key only works while the holder carries the item
Config.Keys.max 30 Keys per operator
Config.Upgrades.lock { price = 1800, pryFactor = 1.8 } Reinforced lock: prying takes 1.8 × longer
Config.Upgrades.alarm { price = 1200 } The alarm goes off sooner
Config.Upgrades.camera { price = 1500 } Names the thief in the owner's log
Config.Upgrades.insurance { price = 900, cover = 60, weekly = 150 } Pays back 60 % of a break-in loss and of repairs; adds $150 a week to the rent

Routes, jobs and wholesale ​

Option Default Description
Config.Routes.maxStops 8 Stops per route
Config.Routes.minutesPerStop 3 Time estimate per stop
Config.Routes.kmPerMinute 0.7 Driving estimate
Config.Routes.depot { x = 1200.0, y = -3250.0, z = 5.9, label = 'Wholesale depot' } Start of every route
Config.Jobs.enabled true Paid restock jobs
Config.Jobs.minReward 50 Lowest reward
Config.Jobs.maxOpen 5 Open jobs per operator
Config.Jobs.hours 6 A taken job must be done within this, else it returns to the board
Config.Wholesale.enabled true Stock items sold at the depot through the inventory's shop (np_inventory / ox_inventory RegisterShop)
Config.Wholesale.label 'Vending wholesale' Shop name
Config.Wholesale.coords the depot Shop position
Config.Wholesale.factor 0.5 Wholesale price = item price × factor (at least $1)

Crime (16_crime.lua) ​

Option Default Description
breakIn.enabled true Prying the cash box
breakIn.seconds 20 Prying time (× Upgrades.lock.pryFactor with a reinforced lock)
breakIn.noiseSeconds 14 The noise bar fills in this time; at 100 % the alarm goes off
breakIn.alarmNoiseSeconds 6 The same with an alarm upgrade
breakIn.loot { 40, 80 } % of the cash box taken
breakIn.cooldownMinutes 30 Per machine
breakIn.minCash 50 A box with less isn't worth it
breakIn.weapons { 'WEAPON_CROWBAR' } A crowbar in hand counts as well as the crowbar item
breakIn.cityMachines true City machines can be broken into
breakIn.cityFloat { 40, 160 } Cash a city machine's box refills with
vandalism.enabled true Smashing a machine
vandalism.seconds 8 Time to smash
vandalism.cooldownMinutes 20 Per machine
vandalism.repairCost 400 The owner pays this (minus insurance) or uses a repair kit
skimming.enabled false Optional card skimmer
skimming.seconds 6 How long installing a skimmer takes
skimming.share 15 % of card sales the skimmer takes
skimming.findChance 35 % per service visit that the owner finds it
skimming.payoutMinutes 60 How often the skimmer's share is paid
policeJobs { 'police', 'sheriff', 'state' } Who gets the alarm
minPolice 0 Break-ins need this many police on duty
dispatch nil function(src, data) for your dispatch. data = { kind, coords, machine, code, label, street? }. See Crime → Dispatch

Age and licences ​

Config.Identification is set in integrations/np_identification.lua unless you define it in the config yourself.

Option Default Description
idDocument 'id_card' np_identification document type that carries the date of birth
unknownAge 'deny' 'deny' or 'allow' an age-locked slot when nobody knows the buyer's age
licenses 'allow' Without np_identification: 'allow' or 'deny' licence locks

UI (17_ui.lua) ​

Option Default Description
Config.Ui.streamDistance 120.0 np_prophandler spawns player machines within this distance (5 to 300 m)
Config.Ui.interactDistance 2.0 Prompts show within this distance
Config.Ui.keys use E (38), again G (47), service H (74) Control ids and key labels
Config.Ui.commands { dashboard = 'vending', admin = 'vendingadmin' } Command names
Config.Ui.keyMapping { dashboard = '', admin = '' } RegisterKeyMapping defaults ('' = unbound, players bind it)
Config.Ui.useMenu true np_menu context options on the props (the prompts stay)
Config.Ui.blips { owned = true, sprite = 52, colour = 2, scale = 0.6 } Blips for your own machines
Config.Ui.drinkAnims can, bottle, coffee, bar Animation dict, clip, prop and duration per anim
Config.Phone.app { id = 'vending', name = 'Vending', icon = 'fa-solid fa-bottle-water', tint = 'green', default = false, … } The np_phone app. default = false: players install it from the App Store
Config.Phone.senderLabel 'Vending' Sender of texts to offline owners
Config.Alerts all true lowStock, cashFull, breakIn, rentDue, listingSold, watchBack

Shops (18_shops.lua) ​

Config.Shops lists shop entrances for the shop spacing rule: { label, x, y, z }. Shipped: five 24/7, three LTD and three Rob's Liquor entrances. When np_shops runs and offers exports.np_shops:GetShops(), its entrances are added on top.

Minigames (19_minigames.lua) ​

Config.Minigames: enabled, maxMove (2.5 m), failAlarm, and per use { enabled, game, difficulty, opts } for breakIn (lockpick, medium), reinforced (drill, hard), vandalism (off), skimming (wires, medium) and shake (off: it replaces Jams.shakeChance). Used only while np_minigames runs. See Crime → Minigames.

Editable in np_admin ​

With np_admin running, these keys are on its Resource settings page under Vending machines (shared/np_admin_settings.lua). np_admin stores only the overrides; shared/config/ stays the default. Changes apply live. The settings are listed even while np_vending is stopped.

Category Keys
Spacing Spacing.sameOwner (0–200 m), Spacing.otherOwner (0–300 m), Spacing.sameTypeOther (0–400 m), Spacing.worldMachine (0–200 m), Spacing.shop (0–200 m), Spacing.groupCountsAsOwner, Spacing.tighten
Limits Limits.perPlayer, Limits.perCompany, Limits.permitFee, Placement.enabled
Economy Economy.rent.enabled, Economy.rent.graceDays, Stamps.enabled, Stamps.every, Jams.enabled, Jams.chance, Market.enabled
Crime Crime.breakIn.enabled, Crime.vandalism.enabled, Crime.skimming.enabled, Crime.minPolice
Minigames Minigames.enabled, Minigames.failAlarm, Minigames.maxMove, and enabled, game, difficulty for breakIn, reinforced, vandalism, skimming, shake
World World.cityStocked, World.purchasable

The spacing and limit numbers are the same ones the staff screen edits. A change saved in np_admin wins: it drops the staff screen's own override of that key.