Skip to content
Documentation
Jobs & Systems1Billing System

r_billing Configuration

r_billing config: framework, currency, jobs and bosses, commission, limits, commands, late fees, premade bills, company banking, Discord pictures, notifications and logs.

All settings live in config.lua. Restart the resource after changing it.

General

R.Framework = 'auto'          -- 'auto' | 'esx' | 'qb' | 'qbox' | 'standalone'

R.Currency = {
    symbol    = '€',     -- currency symbol
    after     = true,    -- false = before the amount (€1,000) · true = after (1,000€)
    separator = '.',     -- thousands separator
}

R.AutoInsertSQL = true
R.Debug = false

Leave R.Framework on 'auto'. R.AutoInsertSQL creates the tables on start. R.Debug = true lets you bill yourself for testing, keep it false on a live server.

The language comes from ox_lib: setr ox:locale "en" in server.cfg (en or fi). Add your own by copying a file in locales/.

Jobs

R.Account  = 'bank'           -- money account bills are charged from
R.CashPayments = true         -- players can also pay with cash on hand

R.AllowedJobs = {
    'police',
    'ambulance',
}

R.BossGrade     = 'boss'        -- grade *name* treated as boss on ESX | QB/Qbox use `isboss` flag.
R.UnemployedJob = 'unemployed'  -- this job can never send bills

R.MaxBillAmount = 500000        -- hard cap for a single bill
R.PlayerRadius  = 4.0           -- how close a target must be to get billed
OptionWhat it does
R.CashPaymentsAdds a Bank / Cash choice in My Bills. false = bank only.
R.AllowedJobsJobs that can send bills. Use the exact job name.
R.BossGradeWho gets the Company tab on ESX. QBCore and QBox use the grade's isboss.
R.MaxBillAmountHighest amount one bill can have.
R.PlayerRadiusHow close a player has to be to get billed.

Commission

R.Commission = {
    default = 10,             -- % of each paid bill that goes to the employee who sent it, 0 = off
    jobs = {
        ['ambulance'] = 15,   -- per-job override
    },
}

The employee who sent the bill gets this share when it is paid, the rest goes to the company. If they are offline, it is paid the next time they join. Employees see what they earn before sending, and bosses see it per employee in the Team tab.

Commands & Key

R.Commands = {
    open    = 'bills',
    send    = 'billing',
    company = 'company',
}

R.OpenKey = 'F7' -- Set to '' to register no keymapping.

Players can rebind the key in FiveM settings.

Overdue Bills

R.Overdue = {
    remind          = true,   -- ping players that have overdue bills
    intervalMinutes = 15,     -- how often to run the overdue check
    lateFee         = 10,     -- % added once when a bill expires, 0 = off
    autoPayDays     = 0,      -- charge R.Account automatically this many days after expiry, 0 = off
}
OptionWhat it does
remindReminds online players about their overdue bills.
lateFeeAdds this percentage to a bill once, when it goes overdue.
autoPayDaysPays an overdue bill from the player's bank this many days later, if they are online and can afford it. Off by default.

Premade Bills

R.Bills = {
    ['police'] = {
        ['Speeding ticket']   = { description = 'Exceeding the posted speed limit.',      price = 1200, expireDays = 7  },
        ['Reckless driving']  = { description = 'Dangerous operation of a vehicle.',       price = 2500, expireDays = 7  },
        ['Illegal parking']   = { description = 'Parking in a restricted zone.',           price = 400,  expireDays = 5  },
    },
    ['ambulance'] = {
        ['Emergency call-out'] = { description = 'Emergency transport and treatment.',     price = 1500, expireDays = 7  },
        ['Medical check-up']   = { description = 'Routine examination at the hospital.',    price = 600,  expireDays = 10 },
    },
}

expireDays is how long until the bill is overdue. Bosses can also add templates in-game from the Company tab.

Company Banking

Paid bills go to the job's society account. ESX society, Renewed-Banking and qb-banking work out of the box. For another banking script, edit CreditSociety in server/sv_custom.lua:

function CreditSociety(job, amount)
    exports['your-banking']:addAccountMoney(job, amount)
end

Commission is paid with PayEmployee(src, amount) in the same file, to R.Account by default.

Discord Pictures

R.Avatars = 'auto' -- Discord pictures in the team list and nearby players: 'auto' | 'trase' (trase_discord) | 'badger' (Badger_Discord_API) | 'none'

With trase_discord or Badger_Discord_API running, the Team tab and the nearby players list show each player's Discord picture. Without one, everyone gets the default picture.

Other Billing Scripts

R.Compat = {
    esx_billing = true,       -- answer esx_billing events so other scripts keep working
    okokBilling = true,       -- answer okokBilling:CreateCustomInvoice
    maxDistance = 15.0,       -- how close the target must be for those events
    allowedJobsOnly = true,   -- true = only R.AllowedJobs can bill through those events
}

Job scripts written for esx_billing or okokBilling keep working and their bills show up in R_Billing. With allowedJobsOnly = true, add every job that bills this way to R.AllowedJobs. Updating from 2.1.0 with your old config? Add the allowedJobsOnly line yourself.

Notifications & Logs

-- Options: 'auto' | 'esx' | 'ox_lib' | 'qb' | 'okok' | 'quasar' | 'codesign'
R.Notify = 'auto'

-- Put your Discord webhook in server/sv_custom.lua
R.Logs = {
    enabled = true,
    type    = 'webhook',   -- 'webhook' | 'ox_lib'
}

Another notify script? Edit Notify in client/cl_custom.lua. The webhook goes at the top of server/sv_custom.lua.

Interface Colours

The same colour settings as every R-Scripts resource. The defaults are what you see out of the box.

R.UI = {
    Accent = "#9a27ea",        -- icons, bars, badges and highlights
    Primary = "#ffffff",       -- main action buttons
    PrimaryText = "#000000",   -- text on those buttons
    NavActive = "",            -- selected tab background, "" keeps the default
    NavActiveText = "#ffffff", -- selected tab text
}