Skip to content

Releases

v1.0.1

Choose a tag to compare

@vezironi vezironi released this 27 Nov 10:35
16a3207
hype-vendingmachine

hype-vendingmachine

Player-owned vending machines with restock deliveries, staff and an admin panel

Hype Vending Machine adds player-owned vending machines to FiveM. Owners buy machines, set prices, hire staff and earn from every sale, while stock is ordered from a supplier and delivered by hand with a cart. Admins place and manage every machine from an in-game panel.

FiveM
Lua
Frameworks
Version

Features · Screenshots · Installation · Configuration · Usage · Admin panel · Credits


Features

For customers

  • Shop menu with product images, categories, search and a cart.
  • Cash or bank payment, with both balances shown. Owners choose which methods a machine accepts.
  • Glass machines (optional, see Glass machines) show the shop on their own touchscreen, and a robotic arm carries each item to the tray.

For owners

  • Buy machines that are for sale, up to a per-player limit.
  • Dashboard with today's and weekly revenue, a 7-day chart, top products and recent sales.
  • Products: set the price of every product, see stock, units sold and every purchase.
  • Restock from the supplier with the machine balance: wholesale prices, "fill to capacity" and order tracking from preparing to completed.
  • Deliveries by hand: pick the order up with a cart, move the boxes into any vehicle's trunk and put them into the machine.
  • Auto restock when a product hits the low stock threshold, plus low stock and sale notifications.
  • Cash: withdraw and deposit money, with a full history.
  • Opening hours by in-game time, or a simple open / closed switch.
  • Transfer the machine to another player or sell it back for a refund.

Staff

  • Hire nearby players as Employee, Supervisor, Manager or with custom permissions.
  • 13 permissions, from viewing stats to ordering stock, withdrawing money and managing staff.
  • Staff can never sell or transfer a machine.

For admins

  • Overview: revenue, items sold, owners, top machines and machines that need attention.
  • Machine list with a map: teleport, enable / disable, reset the balance, delete.
  • Placement tool to create and move machines in game (move, rotate, snap to ground).
  • Export / import machines as JSON to move them to another server.
  • Global settings from the panel: wholesale multiplier, sales tax, machines per player, delivery time and defaults.
  • Discord webhook logs for machine purchases and admin actions.

Security

  • Prices, stock, capacity, balances, distances and permissions are all checked on the server.
  • Items that don't fit in the inventory are refunded.
  • 10 locales: English, Turkish, German, Spanish, French, Portuguese, Arabic, Chinese, Hindi and Bengali.

Screenshots

Shop Touchscreen
Shop menu with cart Touchscreen on a glass machine
Owner dashboard Restock
Owner dashboard Ordering stock from the supplier
Admin machines Staff
Admin machine list with map Staff and permissions
More screenshots
Checkout Buy machine
Checkout, cash or bank Buying a machine
Products Cash
Products, prices and stock Cash, withdraw and deposit
Machine settings Admin overview
Machine settings Admin overview
New machine Admin settings
Creating a machine Admin settings

Requirements

Resource Link / notes
ox_lib https://github.com/overextended/ox_lib/releases/latest
oxmysql https://github.com/overextended/oxmysql/releases/latest
Framework qbx_core, qb-core or es_extended
Target ox_target or qb-target (optional, falls back to a key prompt)
Glass machines olentrix_vending (optional)
Database MySQL 5.7+ or MariaDB 10.2+ (JSON columns)

Installation

  1. Put the folder in resources. It has to be named hype-vendingmachine.

  2. Start it after its dependencies in server.cfg:

    ensure ox_lib
    ensure oxmysql
    ensure qbx_core          # or qb-core / es_extended
    ensure ox_target         # optional: ox_target or qb-target
    ensure olentrix_vending  # optional, glass machines
    ensure hype-vendingmachine
    
    setr ox:locale "en"
  3. Database. With AutoRunSQL = true (default) the tables are created on start. If that fails, or you turned it off, run INSTALL/insert-me.sql once. It is safe to run again. It creates:

    Table Contents
    hype_vending_machines Placed machines: position, model, owner, price, capacity, status, balance and owner settings
    hype_vending_products Each machine's products with the owner's price, stock and units sold
    hype_vending_transactions Every purchase. Revenue and sales charts are built from it
    hype_vending_cash Deposits, withdrawals and stock order payments
    hype_vending_orders / hype_vending_order_items Supplier orders and their lines
    hype_vending_staff Employees and their permissions
    hype_vending_settings Values saved in the admin panel's Settings page
  4. Items. Every product in Config.Products must exist as an inventory item with the same name (id). Ready-made snippets for ox_inventory and qb-inventory are in INSTALL/items.md. Copy INSTALL/item-images into your inventory's image folder.

  5. Props. Everything in stream/ is streamed automatically, including the hype_cargo_box cart (its .ytyp is loaded by fxmanifest.lua).

  6. Set products, machine models and pickup points in config/config.lua, restart, then create your machines in game with /vendingmenu.

Configuration

All options are in config/config.lua and commented in place. The most important ones:

Key Default What it does
AutoRunSQL true Runs INSTALL/insert-me.sql on start
Currency / NumberAndDateFormat USD / en-US How money and dates are shown in the UI, e.g. EUR with de-DE shows 1.250 €
Commands.AdminMenu vendingmenu, group.admin Admin panel command and its permission
Interaction.target true Use ox_target / qb-target when one is running, TextUI otherwise
Interaction.distance / maxDistance / spawnDistance 1.5 / 3.0 / 75.0 Open range, max range the server accepts, prop spawn range
Interaction.keys E / G TextUI keys: shop and owner menu
PurchaseAccount / CashAccount bank / cash Account a machine is bought from, and the account owner deposits / withdrawals use
DefaultSettings Fallback for the admin panel's Settings page. Values saved in the panel win
DefaultOwnerSettings Opening hours, low stock threshold, auto restock, notifications and accepted payments for new machines
Limits Name lengths, max capacity and prices, machine spacing, order and transfer limits, history length
SellRefund 50 Percentage of the machine price paid back when an owner sells it
Cargo Cart and box models, pickup points, cancel distance, attach offsets and animations
StaffPermissions 13 permissions The permissions an owner can give to staff
Machines 4 GTA models + 11 glass models Models offered in the admin panel. arm = true marks glass machines
Screen Glass machine touchscreen: texture, size, camera and corner offsets
Products 9 products id (item name), name, category, starting price, supplier wholesale price, image and...
Read more