All products

np_vending

Vending machines as a player business. Buy the machines that already stand in the city or place your own, within the distances your staff set. Then stock them, set prices, drive restock routes and collect the cash before someone else pries the box open.

v1.0.0ESX · qbx · qb · standaloneRequires oxmysqlRequires np_prophandler 1.1.0+
Price TBAStore link follows at release
Installation guideDocumentation
Version
1.0.0
Frameworks
ESX, qbx, qb, standalone
Dependencies
oxmysql, np_prophandler 1.1.0+
Database
Tables created on start
Inventory
np_inventory, ox_inventory, qb-inventory or none
Payment
np_payments for card and phone tap, or the framework's cash and bank
Optional
np_admin, np_hud, np_phone, np_identification, np_gangs, np_menu, np_shops, np_character, np_discord, np_drugs
Languages
English, German
Build
Node to build the NUI once
A Sprunk machine on Vespucci Boardwalk: twelve slots with stock bars, an offer, a slot that is sold out with notify me, cigarettes locked to 18+ by ID, the keypad, cash, card or phone, the stamp card and the tray
A Sprunk machine on Vespucci Boardwalk: twelve slots with stock bars, an offer, a slot that is sold out with notify me, cigarettes locked to 18+ by ID, the keypad, cash, card or phone, the stamp card and the tray

Taken from the NUI in the browser at 1920×1080. The spacing rings are from the placement mockup.

What's in it

The client only draws. Buying, placing, moving and every sale are checked again on the server.

A machine to buy from

  • A slot grid per model. Click a slot or type its code (A 2) and press Enter.
  • Cash, card or phone tap. Items drop into the tray, then into the inventory.
  • Drink now, same again with G, offers, a stamp card, jams and a mystery capsule slot.

Buy city machines

  • Every vending prop on the map is a city-owned machine you can buy at the machine.
  • The card shows the price, weekly spot rent, foot traffic and average sales of the last 7 days.
  • Ownership is a deed item: trade it, use it as collateral, or have it seized.

Place your own

  • From a crate item. A ghost prop that snaps to walls, with live spacing rings on the ground.
  • A checklist of every rule, the distance to the nearest machine of each kind and the nearest free spot.
  • Pick it up and place it somewhere else. The permit is due again.

Spacing rules

  • Separate minimum distances for the same operator and for different operators, per zone and per model.
  • No-vend zones, staff-only zones and limits per player, company and zone.
  • A live ring preview. Changes apply without a restart.

Operator dashboard

  • Every machine with stock, cash box, sales and status. Prices per slot, offers and happy hours.
  • Finance, staff and keys, and wholesale orders delivered to a depot.
  • Machines can belong to a player, a company or a gang.

Routes and jobs

  • A restock route sorted by lost sales, with GPS stops and what to load at the depot.
  • Drive it yourself or post it as a paid job other players take from the board.

Market and auctions

  • List a machine with or without its stock, at a fixed price or as an auction.
  • Unpaid rent closes a machine. After a grace period it returns to the city, and hot spots go to a timed auction.

Crime

  • Pry the cash box with a crowbar. A noise bar fills, and at 100 % the alarm tells the owner and the police.
  • Vandalism and optional card skimmers.
  • Upgrades against it: a reinforced lock, an alarm, a camera and insurance.

A closer look

The machine

E opens a machine, G repeats the last purchase, Esc closes. The keypad works from the keyboard.

  1. Pick a slot: one tile per product with a coil bar. Low stock, sold out with "notify me", an offer with an end time, or locked by age, licence or job.
  2. Pay: cash goes into the machine's cash box, card and phone tap through np_payments. The owner switches each one per machine.
  3. Take it: items drop into the tray and go into the inventory. If they don't fit, they wait in the tray for two minutes.
  4. Come back: every tenth item at one operator is free on the stamp card. Sometimes an item gets stuck: hold E to shake, or ask for a refund.

Soda (Sprunk, eCola), snacks (Candybox), coffee (Bean Machine), a water cooler, cigarettes (the owner needs a licence, configurable) and a gumball or capsule machine, each with its own slots, price and items. Frosted glass by default, Liquid Glass as a player setting.

Buying a machine that already stands there

The vending props of the map are city machines, stocked by the city until a player buys them.

A city-owned eCola machine on Legion Square for sale for $18,500: spot rent $350 a week, high foot traffic, $420 a day on average, Inspect with G and Buy with E
  • Price by foot traffic: busy spots cost more and pay more rent.
  • The card shows the average sales of the last seven days before you buy.
  • You get a deed. Whoever uses a valid deed registers the machine, and every new owner voids the older deeds.
  • Pay from your bank or a company account. Player listings and auctions use the same card.

Placement mode

Use a vending_crate, type /vending place or press "Place new machine" on the dashboard. The client runs the same spacing engine as the server.

The ghost eCola machine between your own Sprunk machine with a green 25 m ring and a rival's machine with a red 60 m ring, 48 m away where 60 m is needed, and the nearest free spot 10 m away
  • Rings on the ground around every machine nearby, green for yours and red for the rules you break.
  • A checklist with the distance to each kind of machine, the zone, the surface and your limit.
  • The nearest free spot is marked when a rule fails.
  • Foot traffic, estimated sales, rivals within 150 m and what is due now: machine, permit and the first week of rent.

Spacing rules for staff

/vendingadmin or the np_admin tools. Distances are in metres, 0 switches a rule off, and a pair of machines uses the stricter of their two rules.

RuleMinimum distance betweenDefault
Same operatorTwo machines of one owner, company or gang25 m
Different operatorsMachines of rivals60 m
Same typeTwo soda machines of different operators90 m
City machinesA new machine and a map machine nobody has bought15 m
ShopsA new machine and a store entrance (np_shops)40 m
LimitsMachines per player and per company, and the placement permit10, 25, $1,200
  • Zones override the distances, the machine limit, the rent and the foot traffic. The boardwalk allows tighter spacing than Blaine County.
  • Models have their own spacing: a water cooler needs less room than a soda machine.
  • No-vend zones such as police stations and hospitals, where nobody or only staff may place.
  • "Same operator" can include a company or gang, so its members share the short distance.
  • A stricter rule keeps existing machines and marks them in the preview. Export everything as a config.lua snippet.

Running the business

/vending, the vending_tablet item or the phone app open the dashboard for every operator you work for.

Coastal Vending Co.: $2,146 sales today, $1,738 in the cash boxes, 9 of 84 slots empty, 34 % margin after rent, the machines by stock, a vandalised machine, the sales chart and a restock route with three stops
  • Stock from the inventory: carry crates to the machine and fill slots through the service door. Wholesale orders go to a depot.
  • Cash box: cash sales stay in the machine until someone collects them. A full box stops cash sales. Card sales go to the bank every hour.
  • Restock route sorted by lost sales. Drive it, or post it as a paid job for other players.
  • Staff and keys: a key item for one machine or all of them, with rights to restock, collect and set prices.
  • Spot rent by zone or foot traffic, paid weekly and automatically from the operator's account.

Break-ins and upgrades

The server times the pry and fires the alarm. The owner and the police get the location.

WhatHow it works
Break-inHold E with a crowbar to pry the cash box. A noise bar fills, at 100 % the alarm goes off and the loot is a share of the box
VandalismHold G with a crowbar. The machine is out of order until the owner pays for the repair or uses a repair kit
SkimmingOff by default. A device on the card reader takes a small share of card sales until the owner finds it during service
UpgradesA reinforced lock makes the pry longer, an alarm goes off sooner, a camera names the thief in the owner's log, and insurance pays part of the loss and the repair
DispatchConfig.Crime.dispatch, np_drugs' dispatch, or toasts and a GPS mark for police on duty

np_phone Vending app

With np_phone running, np_vending adds a Vending app.

Vending app: my machines with what needs you, one machine with its slots and cash box, the restock route with the job board, and the market with machines for sale
  • Machines: what needs you first, sales and cash, switch a machine on or off.
  • Route: the stops with GPS, and the job board to take a restock run.
  • Market: machines for sale, free spots and auctions with bids.
  • Alerts: low stock, a full cash box, a break-in, unpaid rent and a sold listing, as texts when the owner is offline.

Without np_phone the alerts are toasts, and an inbox shows what happened at the next login.

Set it up

Compatibility

Every bridge is detected at start. np_prophandler 1.1.0+ is required. Every other NP DEV sibling is optional and has a built-in fallback. No ACE is used anywhere.

KindSupported
Frameworkes_extended first, then qbx_core, qb-core or standalone
Inventorynp_inventory first (items registered on start, drink now through its use flow), then ox_inventory, qb-inventory or no carried stock
Paymentnp_payments for card (quick pay) and phone tap, or the framework's bank account
Company moneyesx_addonaccount, qb-management, qb-banking or Renewed-Banking society accounts, or np_vending's own company balance
Age and licencesnp_identification, or np_character and the framework's date of birth
UInp_hud for toasts, prompts and progress, np_phone for the Vending app, np_menu (or ox_target, qb-target) for options on the props
Staffnp_admin permission nodes, settings, audit log and the server theme, or identifiers, the framework's admin groups and np_discord roles
Othersnp_gangs for gang-run machines, np_shops for the shop distance rule, np_drugs for police dispatch

Installation

oxmysql and np_prophandler 1.1.0+ are the hard dependencies. The tables are created on start.

  1. Put the resource in resources/ as np_vending.
  2. Build the NUI once (web/dist is not in the repository):
    cd web && npm install && npm run build
  3. Start it after oxmysql, your framework, your inventory and the np_* resources you run:
    ensure oxmysql
    ensure es_extended     # or qbx_core / qb-core (optional)
    ensure np_inventory    # or ox_inventory / qb-inventory (optional)
    ensure np_admin        # optional: permissions, settings, theme
    ensure np_prophandler  # required, 1.1.0+
    ensure np_vending
  4. Items: nothing to do with np_inventory. On ox_inventory or qb-inventory, add the crate, deed, key, tablet and drink items from the docs.
  5. Staff: with np_admin, grant vending.admin, vending.admin.rules, vending.admin.zones and vending.admin.machines. Without it, list identifiers or admin groups in the config.
  6. On start the console prints one line per sibling: active, fallback or missing export, then a ready line.

For your own scripts

Server exports to read machines and rules, add machines for an MLO or a business, and hooks that can veto a sale, a placement or a break-in.

-- the same spacing check placement mode runs
local ok, err, checks = exports.np_vending:CanPlaceAt(source, 'sprunk', coords)
-- err e.g. 'too_close:otherOwner', 'zone_off', 'limit_reached'

-- a machine that comes with your MLO, owned by a company
exports.np_vending:AddMachine({
  model = 'coffee', coords = vector3(-627.1, 239.4, 81.9), heading = 90.0,
  operator = 'job:beanmachine', operatorName = 'Bean Machine',
})

-- no sales while the player is cuffed
exports.np_vending:registerHook('canBuy', function(data)
  if isCuffed(data.source) then return false, 'vetoed' end
end)

Questions

Do the machines on the map work?

Yes. Every vending prop is a city machine, registered the first time someone uses it and stocked by the city. Players can buy it at the machine, and the price follows the foot traffic of the spot.

Can players stack machines next to each other?

Only as close as your rules allow. Staff set separate distances for the same operator, rivals, the same machine type, city machines and shops, with overrides per zone and per model. The server checks them again on every placement.

What happens to existing machines when a rule gets stricter?

They stay. The admin preview marks them, and they can't be moved into another breach.

Do I need np_inventory?

No, but it is the first choice: it registers the items itself and drink now uses its own use flow. ox_inventory and qb-inventory work with the items from the docs. Without an inventory, stock isn't carried.

Does it need np_admin?

No. With np_admin you get permission nodes, the settings in its panel, the audit log and the server theme. Without it, staff come from identifiers, the framework's admin groups or np_discord roles.

Is it in German?

English and German, with currency formatting per locale, set with Config.Locale.

Works well with

Ensure it, set your rules, open the city's machines.

Installation, every config key and every export are in the docs.

Install np_vending