dreamscripts-docs

Dream Billing

Billing system for ESX servers: job invoices, private invoices, automatic late fees, company overview for bosses, invoice lookup for the police and an admin area. Compatible with esx_billing.

Built with AI assistance, tested on our live roleplay server DreamRP (ESX Legacy). Other frameworks are marked as beta where they apply. Version 1.1.6 (from fxmanifest.lua). Resource folder: dream_billing.

Billing menu

Write an invoice

Features

Requirements

es_extended and oxmysql are listed under dependencies in fxmanifest.lua. QBCore, Qbox and standalone are not supported.

Installation

  1. Stop esx_billing if it is running, otherwise invoices arrive twice.
  2. Put the folder dream_billing into your resources folder. Do not rename it.
  3. Add ensure dream_billing to your server.cfg, after es_extended and oxmysql (and after esx_addonaccount if you use it).
  4. Edit config.lua (jobs, late fee, theme). For a Discord log, enter your webhook in server_config.lua.
  5. Start the server. The table dream_billing is created automatically, no SQL import needed.

Configuration

Main file: config.lua. Texts: locales.lua. Server-only: server_config.lua (Webhook, BotName, BotLogo, ImportOldTable).

Option Default Meaning
Config.Locale 'en' 'en' or 'de'
Config.Command / Config.DefaultKey 'openbillingmenu' / 'Y' Menu command and default key (players can rebind)
Config.AdminCommand 'billingadmin' Opens the admin tab
Config.Currency '$' Currency sign
Config.FullJobs police, ambulance, mechanic Jobs where every employee may write invoices
Config.BossOnlyOthers true Other jobs with a company account: only the boss
Config.ExcludeJobs unemployed Jobs that may never write invoices
Config.PersonalBills true Allow private invoices
Config.SearchJobs police Jobs that may look up other persons’ invoices
Config.ForeignPayment true Pay other people’s invoices by number
Config.AdminGroups admin, superadmin Admin access (ACE command also counts)
Config.MaxDistance 8.0 Max. distance between sender and receiver
Config.MaxAmount / Config.Tax 10000000 / 0 Highest invoice amount / tax in %
Config.LateFee enabled, { days = 3, percent = 100 }, checkMinutes = 10 Late fee stages
Config.Templates mechanic, ambulance Quick buttons per job
Config.SocietyPrefix 'society_' Prefix of company accounts
Config.Notify 'esx' 'esx' or 'custom'
Config.Theme gold accent Colours, logo letters, server name

Commands and keys

Exports and events

Localization

English (default) and German via Config.Locale. Menu, notifications and Discord log texts are in locales.lua. Custom locale files from older versions: copy the new keys from the English block (see changelog).

Performance

Resmon values are estimated from the code, set low on purpose (not measured on every server setup): idle roughly 0.00-0.01 ms. Values rise briefly while the interface is open or while the script handles a request. Please check resmon on your own server.

FAQ and troubleshooting

Invoices arrive twice. esx_billing is still running. Stop it. If it starts while Dream Billing runs, Dream Billing leaves the esx_billing:sendBill event to it and prints a warning.

Invoices imported from codem_billing cannot be paid. Old invoices without company and issuer are refused before any money moves. Delete or cancel them in the admin area.

A refund pushes the company account below 0. That is intended, the money may already have been spent.

The menu shows an error instead of loading. If the server does not answer within 10 seconds, the menu shows an error. Check the server console. Menu requests are rate limited per player.

An employee cannot write invoices. Check Config.FullJobs, Config.BossOnlyOthers and Config.ExcludeJobs.

Custom language texts are missing. Copy new keys from the English block of locales.lua; missing keys show the English default.

Support

Changelog (short)

Full changelog: CHANGELOG.md inside the resource.