Skip to content

🩺 Medic

Documentation relating to the spooni_medic.

1. Installation

spooni_medic works Standalone.

To install spooni_medic:

  • Download the resource
  • Ensure that all requirements are installed
  • Drag and drop the resource into your resources folder
    • spooni_medic
  • Add this ensure in your server.cfg (after spooni_libs and jo_libs)
      ensure spooni_medic
  • Add the medical items to your inventory database (item + image):
    • Kits: docverify (diagnose), docanimalkit, dochitkit, docweaponskit, docfirstaidkit (revive kits), birdalert (send an injury alert).
    • Bandage / splint: bandage (heals + stops bleeding), splint (fixes a broken bone).
    • Disease cures: antipoison, rabia_vaccine, anthrax_vaccine, plague_vaccine, hepatitis_vaccine, typhus_vaccine, scarletfever_vaccine, chlorine_antidote, foodpoisoning_vaccine, cold_medicine.
    • Misc: typhus_injection (infect a player), medicmask (protects the doctor), medicuniform (the wardrobe uniform item), docdiagnostic (a saved diagnostic sheet).
  • Create the medic jobs you list in Config.AllowedJobs (e.g. medicval, Medic, ...)
  • Now you can configure and translate the script as you like
    • config.lua
    • language.lua
  • At the end, restart the server

If you have any problems, you can always open a ticket in the Spooni Discord.

2. Usage

On-duty doctors diagnose, heal, revive and cure players, run a medicine cabinet, drive a medical wagon, manage their staff and respond to injury calls. Players can catch diseases from bites, bad water, poison, cold weather and certain zones/plants, bleed from combat, and break bones from hard falls — then get patched up with items or by a doctor. An AI doctor fallback revives injured players even when no medic is on duty.

3. For developers

Reference

Optional integrations (turn on in config.lua only if you actually run them):

  • spooni_metabolism — shows a disease icon on the health core and refills cores on heal/revive.
  • spooni_registry — logs cabinet buys and stash movements.
  • spooni_npcmissions (medic module) — adds a Missions entry to the cabinet menu.
  • spooni_medicarchives, spooni_identitycard — patient discharge / registration (off by default).

What a medic can do

Go on/off duty — at a cabinet station take the ON-DUTY / OFF-DUTY action (hold ALT on the target, or the classic prompt if UseSpooniTarget = false), or type /medonduty. You get paid over time while on duty (UsePayment) — paid by the server, out of the station's own account, or by a script of yours through an export (PaymentSource).

Medical menu (the MEDICAL MENU action at the cabinet):

  • Take Medicine — buy any of the kits, bandages, splints and disease cures from the cabinet shop (filtered by your grade with JobGradeBuy).
  • Spawn Wagon — pull out the medical wagon; park it again and open its stash from the wagon.
  • Open Inventory — the shared cabinet stash.
  • Employ Players — hire a nearby player into one of your medic jobs.
  • Medic List — see your staff and fire / promote / demote them.
  • Payment Management — edit the pay amount and interval and add/remove paid grades, in-game.
  • Missions / Registry — shown only if those optional resources are running.

Diagnose a patient — use docverify next to a player to open the diagnostic sheet: cause of death (if they're dead), whether they're bleeding, which bone is broken, and any disease they carry. It reads live players too (to spot a disease). Hit Save on the panel to store the diagnosis as a docdiagnostic item (use that item later to reopen the sheet); toggle the panel off with DiagnosticUI = false.

Uniforms (wardrobe) — take the Change Clothes action at a cabinet to browse the medic uniforms (separate man / woman lists, previewed live as you scroll) and pick one. That hands you a medicuniform item: use the item any time to put the uniform on, use it again to take it back off (back to your own outfit) — on or off duty, and it survives a /rc. You can lock individual uniforms to certain jobs / a minimum grade with UniformLock, and with UniformLockJob = true only your medic jobs can use the uniform item at all. Turn the whole feature off with Clothing = false.

Revive the dead — each wound kit revives specific causes of death:

  • docanimalkit — snake/wolf/bear/big-cat/crocodile and other animal deaths.
  • dochitkit — falls, horses, wagons, fists, melee, bows.
  • docweaponskit — guns, thrown weapons, cannons, burns.
  • docfirstaidkit — anything else / unknown causes. Kits carry durability (UseMetadata) and wear down with each use.

Heal + stop bleeding — bandage — with nobody nearby it treats you; with a player next to you it treats them instead. It restores health and clears bleeding in one go.

Cure diseases — use the matching vaccine/antidote next to a patient and the doctor reaches over and injects them (progress bar); if nobody is nearby you cure yourself. Each disease has its own cure (see the list below). Cure items can be reusable with durability (AntidoteUseMetadata).

Medic mask — carry/use medicmask to be protected from airborne diseases while you treat people (ProtectionTime).

Infect a playertyphus_injection lets a doctor inject typhus into a nearby player (disable with InfectPlayer = false).

Answer alerts — injured players raise calls (see below). The alert board (/alertsystem, or when a call comes in) lists every active call with its distance, zone and caller type (civilian / police / medic), plus a history of taken calls. Accept a call to claim it and get a blip; /removeblip clears your waypoint.

What players go through

Registration — an injured or dead player can walk up to a cabinet, take the REGISTER HERE action and pay a small fee (RegisterPrice) to be laid in a bed and healed/revived, even with no doctor online.

Bleeding — getting hit by a weapon has a per-weapon chance (BleedWeapons) to start bleeding; your health drains over time until you use a bandage or get treated.

Broken bones — a hard fall (BrokenFallHeight) can break a bone: you limp, can't sprint and move slower until a splint or a medic fixes it. Bleeding and broken bones persist across relog until treated.

Diseases — you can catch them from snake bites, wolf bites, big wild animals, small animals, thrown poison bottles, drinking bad river water, certain zones, certain plants, and a cold/flu from staying underdressed in freezing weather or bare-headed in the rain. A disease shows an icon on your health core (with spooni_metabolism), drains health/stamina, plays a sick idle and screen effect, and some diseases disable your weapons/actions. Cure it with the right item or see a doctor.

Snake bite — suck the venom — when a snake bites you, press ALT to drop into a "suck the venom" pose; another player can come over and suck the venom out to cure you, a co-op alternative to the antivenom (SnakeSuckVenom).

AI doctor — if you die and no live medic is on duty, after a short delay an NPC doctor walks over and revives you for a fee (NpcDoctor). A dead on-duty medic doesn't count and also gets the AI doctor.

Diseases & cures

DiseaseCaught fromCure item
Cold / flufreezing weather, raincold_medicine
Snake poisonsnake bitesantipoison
Rabieswolf bitesrabia_vaccine
Anthraxbig wild animalsanthrax_vaccine
Plaguesmall animalsplague_vaccine
Hepatitisbad river waterhepatitis_vaccine
Typhuszones / infection / injectiontyphus_vaccine
Scarlet fevercertain zonesscarletfever_vaccine
Chlorinepoison gas / bottlechlorine_antidote
Food poisoningcertain plantsfoodpoisoning_vaccine

Commands

  • /medonduty — go on/off duty (also on the cabinet target).
  • /alertmedic — send an injury alert to on-duty doctors.
  • /alertsystem — open the alert board (on-duty doctors).
  • /removeblip — clear the alert waypoint.
  • /calldoctor — call the AI doctor while you lie injured. Only exists when NpcDoctorAuto = false; with true he comes on his own and the command is not registered.

(Command names are configurable in language.lua.)

Config highlights (config.lua)

  • Jobs & duty: AllowedJobs, NotAllowedDuty, PoliceJob, FireMedic, JobGrade, JobGradeBuy, UseSpooniTarget.
  • Payment: UsePayment, PaymentTime, PaymentGrade, PayAlertAccepted, MedicAccount (a money account per station), and PaymentSource — where the wage comes from: "server" (out of nothing), "account" (the station's own money) or "export" (another script hands it over, see below).

Paying wages from your own script (PaymentSource = "export")

Set PaymentSource = "export" in the config, then in your own resource (server side) call spooni_medic's export once and hand it a function:

lua
-- in your treasury/economy script, server side
exports["spooni_medic"]:SetPaymentHandler(function(source, amount, station)
    -- source  = the medic being paid
    -- amount  = his wage for this payday
    -- station = the cabinet he clocked on at (may be nil)
    if MyTill < amount then return false end   -- refuse -> the medic is NOT paid, no money is created
    MyTill = MyTill - amount
    return true                                -- yes -> spooni_medic pays him the amount
end)

Every payday spooni_medic calls your function and pays the medic only if it returns true. Call SetPaymentHandler again each time your resource starts, so a restart never leaves a dead handler behind.

  • Alerts: UseNotify, AlertItem, BirdModel, SOSExpireSeconds, MedicalHistory, DistanceUnit.
  • Cabinet & beds: RegisterPrice, BedTime, BedScenario, MedicDistance, Doctors (station list).
  • Kits & shop: Distance, UseMetadata, KitsDurability, RemoveWhenUse, MedicalKits, Items, MedCabItem, DiagnosticUI, ReportItem.
  • Uniforms / wardrobe: Clothing, UniformItem, UniformLockJob, UniformLock (per-uniform job/grade locks).
  • Diseases: Diseases, DiseaseList, disease sources (SnakePoison, WolfDisease, WildAnimals, SmallAnimals, PoisonBottle, WaterDisease, ZoneDisease, PlantDisease), ColdDisease (+ColdFromCold/ColdFromRain/ColdWarmClothing), AntidoteUseMetadata, MedicMask, ProtectionTime, InfectPlayer, DiseaseRemoveOnDeath.
  • Snake suck-venom: SnakeSuckVenom, SnakeSuckTime, SnakeSuckHelpDist, SnakeSuckHelperOffset.
  • Bleeding: Bleeding, BleedItem, BleedTime, BleedDamage, BleedDefaultChance, BleedWeapons, BleedDecal.
  • Broken bones: BrokenBones, BrokenItem, BrokenFallHeight, BrokenChance, BrokenMoveRate, BrokenNoSprint, BrokenWalkStyle, BrokenAnim, BrokenRecover.
  • AI doctor: NpcDoctor, NpcDoctorAuto (comes on his own, or only when called with /calldoctor), NpcDoctorModel, NpcDoctorPrice, NpcDoctorDelay, NpcDoctorTime, NpcDoctorDist, NpcDoctorCooldown, NpcDoctorNoWater, NpcDoctorNoPlayersDist (he stays away if a live player is this close).
  • Death causes, alert-banned zones and disease zones are edited in functions.lua (Config.Hashes, Config.BlacklistZones, Config.DiseaseZones). Discord webhooks per action (leave "" to disable).

Texts for all 7 languages (EN/RO/DE/IT/FR/ES/PT) live in language.lua.

Disease exports (for other resources)

lua
exports["spooni_medic"]:SetSnakePoison(true/false)   -- also SetRabia, SetAnthrax, SetPlague,
exports["spooni_medic"]:SetHepatitis(true/false)     -- SetTyphus, SetScarletFever, SetChlorine,
exports["spooni_medic"]:SetFoodPoisoning(true/false) -- ...
local d = exports["spooni_medic"]:GetCurrentDisease()
exports["spooni_medic"]:ClearCurrentDisease()

Trigger Spooni-Diseases:Client:DrinkWaterRiver / Spooni-Diseases:Client:FoodPoisoning from your water / plant scripts to hook those disease sources.

Duty export

lua
local MEDIC = exports["spooni_medic"]:GetMedicONDUTY()
-- { PlayeronDuty = bool, myJob = string, nrMedicOnDuty = number, source = number }