Docs
Rarx Vending Machines cover

Rarx Vending Machines

Rarx Vending Machines

In-game admin-placed vending machines with custom catalogues, stock, pricing and multi-inventory support

  • Qbox
  • QBCore
  • ESX
  • rarx_vmachines

Overview#

RARX Vending Machines lets admins place fully configurable vending machines anywhere in the world from a clean in-game panel — no config editing or restarts. Each machine belongs to a categorized group (drinks, snacks, coffee, cigarettes or a custom prop set) with its own product list, per-item pricing and optional stock. Products are handed out and verified through whichever inventory you run, and every change is logged to Discord.

Features#

Multi-Framework

QBCore, QBox (qbx_core) and ESX

In-Game Admin Panel

Create, edit and delete machine groups and items from a Vue NUI — no restarts

Placement Editor

Drop and fine-tune props in the world with an on-screen control legend

Prop Catalogue

Drinks, Snacks, Coffee, Cigarettes — or a fully custom prop set

Stock & Pricing

Per-item price and optional stock, persisted to the database

Multi-Inventory

Auto-detects or pin: rarx, ox, qb, qs, ps, origen, codem, tgiann, core

ACE-Gated Access

Management locked behind configurable ACE groups

Discord Webhooks

Full audit log of every group, item and machine change

Requirements#

Requirement Type
oxmysql Required
QBCore / QBox / ESX Required
ox_lib Required
rarx_lib Required (locale/translation helper)
Any supported inventory Required (auto-detected)

Installation#

  1. Download & Extract

    Extract the resource into your resources folder.

  2. Add to server.cfg

    server.cfg
    ensure ox_lib
    ensure rarx_lib
    ensure rarx_vmachines
  3. Set Core & Language

    server.cfg
    setr rarx-lang "en"

    Then set Config.Core in config.lua to match your framework.

  4. Grant Admin Access

    Make sure your account is in one of Config.AdminGroups (e.g. god, admin, superadmin) or grant the custom ace.

  5. Open the Panel

    Use /vmadmin in-game to start creating groups and placing machines.

Configuration#

Core & Integration#

Lua
Config.Core = 'qb-core'            -- 'qb-core' | 'qbx_core' | 'esx'
Config.InventorySystem = 'auto'    -- 'auto' or a specific inventory (see below)
Config.AdminGroups = { 'god', 'admin', 'superadmin' } -- checked with IsPlayerAceAllowed

Behaviour#

Lua
Config.DebugMode      = false
Config.RenderDistance = 60.0       -- metres a machine prop streams in/out
Config.InteractRadius = 2.5        -- metres to show the [E] hint and open it
Config.ToastAnchor    = 'top-right'

Prop Catalogue#

The catalogue lists the props an admin can attach to a group. The fixed categories (drinks, snacks, coffee, cigarettes) auto-fill their props; the custom category starts empty and lets an admin cherry-pick any interactive prop.

Lua
Config.Catalog = {
    { category = 'drinks', label = 'Bebidas', props = {
        { model = 'prop_vend_soda_01',  label = 'Expendedora eCola',   interactive = true },
        { model = 'prop_vend_fridge01', label = 'Nevera de bebidas',   interactive = true },
        -- ...
    }},
    -- snacks, coffee, cigarettes ...
}

Supported Systems#

Frameworks

QBCore, QBox (qbx_core), ESX

Inventories

rarx_inventory, ox_inventory, qb-inventory, qs-inventory, ps-inventory, origen_inventory, codem-inventory, tgiann-inventory, core_inventory

Using the Admin Panel#

  1. Open

    Run /vmadmin (you must be in an admin ACE group).

  2. Create a Group

    Add a group and pick a category. Fixed categories auto-load their props; custom lets you pick your own.

  3. Add Items

    Add the products sold by that group, each with a price and optional stock.

  4. Place Machines

    Pick a prop and place it in the world with the placement editor (move / rotate / confirm using the on-screen legend).

Discord Logging#

Audit logging is configured in config_server.lua. Set a webhook URL per event to relay changes to Discord:

Lua
return {
    active = true,
    channels = {
        groupCreated   = 'YOUR_WEBHOOK_URL',
        groupUpdated   = 'YOUR_WEBHOOK_URL',
        groupDeleted   = 'YOUR_WEBHOOK_URL',
        itemAdded      = 'YOUR_WEBHOOK_URL',
        itemUpdated    = 'YOUR_WEBHOOK_URL',
        itemRemoved    = 'YOUR_WEBHOOK_URL',
        machineCreated = 'YOUR_WEBHOOK_URL',
        machineUpdated = 'YOUR_WEBHOOK_URL',
        machineDeleted = 'YOUR_WEBHOOK_URL',
    },
}

Localization#

Set the language with the rarx-lang convar (shared by all RARX scripts):

server.cfg
setr rarx-lang "es"   # default: "en"

Translations live in translates/ (en.lua, es.lua) and use the RARX Lang (Locale) system.

Troubleshooting#

/vmadmin does nothing

Make sure your account is in one of Config.AdminGroups, or grant yourself the custom ace (e.g. add_ace identifier.xxx vendings.admin allow).

Items not given / not found

Set Config.InventorySystem to your inventory (or 'auto') and confirm the item names you sell exist in that inventory.

Machine prop not visible

Increase Config.RenderDistance, and verify the prop model is valid and streamed.

No [E] prompt

Stand within Config.InteractRadius of the machine; lower the value if needed.

Tables missing

Confirm oxmysql is running and started before rarx_vmachines; the rarx_vmachines_* tables are created automatically on boot.


Support#

Need help? Reach out: