RedM documentation

Murphy's Doctor

Configuration

Epidemics


This page covers shared/config_epidemic.lua: town outbreaks. An outbreak is a disease active in a town for a few hours; players who spend time there may catch it, and doctors are warned so they can expect patients.

How it works

  • An outbreak is started by staff (doc_epidemic start), by another resource (StartOutbreak export) or at random when AutoStart is on.
  • Every CheckIntervalSeconds, each online player standing inside the zone radius rolls the outbreak's exposureChance. On a hit they catch the disease through the infection system: vaccines and immunities protect them, and a player already sick is not infected again.
  • When an outbreak starts, every doctor online is notified ("influenza outbreak reported in Saint Denis"). Doctors who log in during an outbreak are warned too. With AnnounceToZone, players inside the zone get a vaguer warning.
  • An outbreak ends on its own after its duration, or when staff stops it.
  • Active outbreaks are saved and survive a server or resource restart.

Infected players then spread the disease around them as usual if it is listed in Config.Infection.Proximity.Diseases.

Epidemics infect through the infection system: they need Config.Infection.Enabled = true.

Settings

Key Default Description
Config.Epidemics.Enabled true Enables the module (staff command, exports, exposure checks).
Config.Epidemics.CheckIntervalSeconds 300 Seconds between two exposure checks (5 minutes).
Config.Epidemics.MaxActive 2 Maximum number of outbreaks at the same time. The same outbreak cannot run twice in the same zone.
Config.Epidemics.AnnounceToZone false true = players inside the zone (not only doctors) are warned when the outbreak starts.
Config.Epidemics.AutoStart.Enabled false Random outbreaks. Off by default: staff decides.
Config.Epidemics.AutoStart.ChancePerCheck 0.002 Chance (0-1), on every exposure check, to start a random outbreak in a random zone, for the outbreak's default duration. At the defaults, about one random outbreak every 42 hours of uptime.

Outbreaks

Config.Epidemics.Outbreaks is keyed by outbreak id (used in the command and the export).

Field Description
diseaseId Disease id from the medical encyclopedia (see Infection for the list).
exposureChance Chance (0-1) per check for each player inside the zone.
hours Default duration in hours, used when none is given.

Shipped outbreaks:

Outbreak Disease exposureChance hours
grippe influenza 0.03 48
cholera cholera 0.015 24
dysentery dysentery 0.02 24

At the defaults, a player who spends an hour in a town with an influenza outbreak gets 12 rolls at 3%, roughly a 30% chance to catch it.

Zones

Config.Epidemics.Zones is keyed by zone id.

Field Description
label Town name shown in the notifications.
coords Centre of the zone (vector3).
radius Radius in metres.

Shipped zones: saintdenis (450 m), valentine (250 m), blackwater (300 m), rhodes (250 m), strawberry (200 m), annesburg (250 m), vanhorn (200 m).

The same zones also name the place of medical incidents and death certificates ("in Valentine"; outside every zone: "in the wilderness"), see Records and autopsy.

Adding an outbreak or a zone

lua
Config.Epidemics.Outbreaks.typhoide = { diseaseId = "typhoide", exposureChance = 0.02, hours = 36 }
-- coords = the centre of your town (stand there in game and copy your position)
Config.Epidemics.Zones.mytown = { label = "My Town", coords = vector3(0.0, 0.0, 0.0), radius = 200.0 }

The notification sent to doctors uses the outbreak id to name the disease. Add the new id to the epidemic.diseases table of each language file in shared/locales/:

lua
epidemic = {
diseases = { grippe = "influenza", cholera = "cholera", dysentery = "dysentery", typhoide = "typhoid fever" },
-- ...
},

Staff command

doc_epidemic works from the server console and for in-game admins:

Command Effect
doc_epidemic start <outbreak> <zone> [hours] Starts an outbreak. Without hours, the outbreak's default duration is used.
doc_epidemic stop <id/all> Stops one outbreak (by its number) or all of them.
doc_epidemic list Prints the active outbreaks.
doc_epidemic tick [force] Runs an exposure check now. With force, every player inside a zone is infected.

Other resources can use the StartOutbreak, StopOutbreak and GetActiveOutbreaks server exports (see Server exports).

Related: Infection · Treatment · Commands · Localization


Last updated: November 20, 2026