RedM documentation

Murphy's Doctor

Configuration

Billing


This page covers shared/config_billing.lua: the invoices doctors send to their patients, when patients must pay, where the money goes (dispensary treasury or the doctor) and the optional municipal tax with murphy_politics.

How it works

  • A doctor bills a patient from the treatment screen (Home tab: amount and reason). The patient must stand within MaxDistance.
  • The patient gets a window to pay now or pay later. Unpaid invoices can be paid at any time with the /invoices command (see Command) or at any dispensary board.
  • The invoice belongs to the dispensary of the doctor: the nearest dispensary they are a member of within DispensaryRadius, or their first dispensary otherwise.
  • When the invoice is paid:
    1. the municipal tax is taken (when enabled),
    2. the rest goes to the dispensary treasury when it is enabled (Config.Nurse.Treasury.Enabled), otherwise to the doctor who issued it. A doctor who is offline is credited at their next login.
  • Unpaid invoices older than ExpireDays are cancelled automatically (checked every hour).

Pay before care

With PayBeforeCare = true, a patient who has an unpaid invoice from the dispensary cannot be treated: the doctor cannot sign the treatment, operate or apply a bandage until it is paid, and the invoice window has no "Pay later" button. The doctor bills first, the patient pays, then the care goes on. A patient in a coma is never blocked, since they cannot pay.

Settings

Key Default Description
Config.Billing.Enabled true Enables invoices (and the murphy_doctor_invoices table).
Config.Billing.MinAmount 0.5 Smallest invoice, in dollars.
Config.Billing.MaxAmount 250 Largest invoice, in dollars.
Config.Billing.MaxReasonLength 120 Maximum length of the reason, in characters.
Config.Billing.MaxDistance 5.0 Metres between the doctor and the patient to issue an invoice.
Config.Billing.MaxUnpaidPerPatient 5 A new invoice is refused when the patient already has this many unpaid ones.
Config.Billing.ExpireDays 14 Days after which an unpaid invoice is cancelled. 0 = never.
Config.Billing.PayBeforeCare true See Pay before care. false = care right away, the patient pays now or later.
Config.Billing.DispensaryRadius 250.0 Metres. The invoice goes to the nearest dispensary of the doctor within this radius of its board; outside every radius, to the doctor's first dispensary.
Config.Billing.Command "invoices" Command that opens the player's unpaid invoices. nil or "" = no command (the dispensary boards still work).

Municipal tax (murphy_politics)

When murphy_politics runs, a share of every paid invoice can go to the townhall of the dispensary's town. The rate is read live from murphy_politics (its tax table, for the service ServiceId of that townhall), so the town's mayor sets it in game. If the tax is inactive in murphy_politics, nothing is taken.

Key Default Description
Config.Billing.Tax.Enabled false Enables the tax. Needs murphy_politics started.
Config.Billing.Tax.ServiceId "business" Tax service of murphy_politics used for the rate, and credited with the revenue.
Config.Billing.Tax.Townhalls {} { [dispensaryId] = "townhallId" }. A dispensary without a townhall is not taxed.
lua
Config.Billing.Tax = {
Enabled = true,
ServiceId = "business",
Townhalls = {
[1] = "saintdenis_townhall", -- Saint Denis Hospital
[2] = "blackwater_townhall", -- Blackwater Clinic
},
}

Example: a $20 invoice at the Saint Denis Hospital with a 10% business tax: $2 to the Saint Denis townhall, $18 to the hospital treasury.

Treasury

The dispensary treasury is configured with the nurse, under Config.Nurse.Treasury (see Nurse). It collects paid invoices and nurse fees. Members see its balance, last movements and the total of unpaid invoices on the board; the chief withdraws money there or at the duty point. It can also pay the doctors' salary (see Duty).

Related: Nurse · Duty · Dispensaries · Treatment · Integrations · Database


Last updated: November 20, 2026