Features

Official Ledger

The Official Ledger (MDT) for law, doctors, the railroad and the court: records, wanted posters, reports, fines, patients, prescriptions, help calls, case files, warrants, and Config.MDT.

Official Ledger (mdt) is the record book of duty jobs. It opens according to the player's job: Config.MDT.Jobs maps a framework job to a section. Every other job sees a closed ledger. Settings are in apps/mdt/config.lua (Config.MDT).

#Sections

Section For What it holds
law Sheriffs, marshals, police Person lookup, record card, status and notes, wanted posters, incident reports, fines, and the justice pages
doctor Doctors Patients, treatment notes, prescriptions, help calls
rail Railroad A light home page with four tiles that read "coming soon"
court Judge, prosecutor, lawyer, clerk The justice pages, by role

#Law

  • Search people by name (at least Search.MinLength letters), or see recent records.
  • Record card: status, notes, fines and reports of a person. Setting the status to wanted writes a reward (Law.DefaultReward when none is given).
  • Wanted posters: create and clear.
  • Incident reports in three steps: type, place, summary, people involved. Reports have a state.
  • Fines: pick a person standing close by, pick items from the tariff (up to Law.MaxFineItems). The fine becomes a bill in the Ledger, where the person pays it. When no bill can be written, the fine is still put on the record and the officer is told.

#Doctor

  • Add a patient standing close by, set their state, write treatment notes with a diagnosis.
  • Write a prescription from Doctor.Medicines (up to MaxRxItems). With GiveItems = true and an item set, the medicine is put in the patient's inventory when they are close by.
  • Help calls: players call for help with the command /yardim [text] (or another script calls the HelpCall export). Doctors on duty see the calls with the distance and take a route to them. A call whose text contains a word of SevereWords shows as severe.

#Justice and court

Law officers and the court share case files, warrants, arrests, BOLO notices, the penal code, the court docket and person files. The server decides what each role may see and do.

Role What it can do
Law Open cases, add people and charges, write notes and evidence, request warrants, make arrests, create and close BOLOs
Prosecutor Open cases, add people and charges, notes, evidence and motions, take a case, request warrants
Judge Open and take cases, rule, set hearings, give the verdict, sign warrants
Clerk Open cases, add people, notes, set hearings
Lawyer Find a case by number, defend, file motions

Notes of the law and the prosecutor stay internal; lawyers never see them.

#What it needs

Need Notes
A job in Config.MDT.Jobs Everything else sees a closed ledger
Duty With Duty.Required = true, changes (status, notes, fines, reports, prescriptions) are made only on duty. RSG uses the core's duty state; on VORP the ledger keeps its own duty switch
Ledger app For fines as bills. With Law.Invoice.Account = 'company' the officer's job must be in Config.Company.Jobs; with 'personal' the Ledger needs AllowPersonalSend = true

No signal is needed.

#Settings

Key Default What it does
Enabled true Turns the app on
Jobs VORP and RSG examples Job -> { section, label, icon?, role? }
Ranks sheriff, doctor Rank names per job and grade. Missing: the RSG core's grade name, or "Rank N"
Duty.Default true VORP: on duty when joining
Duty.Required true Changes only on duty
Search MinLength = 3, Cooldown = 1500, Limit = 20, Recent = 30 Name search
NearbyDistance 5.0 Metres for fining, adding a patient, giving medicine
NearbyRadius 15.0 Metres of the nearby list (farther players cannot be picked)
Places ten towns Names written on calls and reports (the nearest town). Empty: only the distance

#Jobs

luaJobs = {
    sheriff = { section = 'law', label = 'Valentine Serifligi' },
    marshal = { section = 'law', label = 'Federal Marshal', icon = 'police-marshal' },
    doctor  = { section = 'doctor', label = 'Valentine Hekimligi' },
    railroad = { section = 'rail', label = 'Valentine Gari', icon = 'badge-rail' },
    judge   = { section = 'court', role = 'judge', label = 'Bolge Mahkemesi', icon = 'badge-court' },
},

The shipped list has VORP names (sheriff, deputy, marshal, police, doctor, medic, railroad), RSG names (vallaw, rholaw, blklaw, strlaw, stdenlaw) and the court (judge, prosecutor, lawyer, clerk). A court job's role is judge, prosecutor, lawyer or clerk.

#Law

Key Default What it does
Law.DefaultReward / Law.MaxReward 50 / 10000 Wanted reward in dollars
Law.DefaultCrime 'Sorusturma suruyor' Crime text when none is given
Law.MaxNote / MaxPlace / MaxSummary / MaxCrime 200 / 40 / 600 / 40 Text lengths
Law.MaxReportPeople 8 People on one report
Law.Tariff five items Fine items: id, label, amount in dollars. Keep the ids unchanged
Law.MaxFineItems 5 Items on one fine
Law.Invoice { Enabled = true, Account = 'company', PeriodDays = 7 } Fines as Ledger bills. 'company': the money goes to the job's company till. 'personal': to the officer
Law.ReportTypes six types Robbery, brawl, theft, murder, smuggling, other

#Doctor

Key Default What it does
Doctor.MaxNote 400 Treatment note length
Doctor.Diagnoses six Diagnosis choices
Doctor.Medicines four id, label, dose, item (inventory item, nil = none), amount
Doctor.MaxRxItems 4 Medicines on one prescription
Doctor.GiveItems false Give the prescribed items to a patient close by
Doctor.Calls.Enabled true Help calls
Doctor.Calls.Command 'yardim' /yardim [text]. '': no command, only the HelpCall export
Doctor.Calls.Cooldown 120 Seconds between two calls of one player
Doctor.Calls.ExpireMinutes 15 An unanswered call drops after this
Doctor.Calls.Max 20 Calls waiting at once
Doctor.Calls.DefaultText 'Yardim cagrisi' Text when the player writes none
Doctor.Calls.SevereWords five words Words that mark a call as severe

#Justice

Key Default What it does
Justice.MaxFine 5000 Highest fine a judge may give, in dollars
Justice.MaxJail 240 Longest jail time in minutes (arrest and verdict)
Justice.MaxBail 5000 Highest bail in dollars
Justice.WarrantDays 7 Days a signed warrant is valid
Justice.SentenceEvent '' Server event fired on a guilty verdict
Justice.ArrestEvent '' Server event fired on an arrest
Justice.PenalCode 27 crimes id, label, class (misd, felony, capital), fine in dollars, jail in minutes. Keep the ids unchanged

An arrest adds up the fines and jail times of the chosen crimes, capped by MaxJail.

A jail or fine script can act on the two events:

lua-- Config.MDT.Justice.SentenceEvent = 'myjail:sentence'
AddEventHandler('myjail:sentence', function(data)
    -- data = { person, character, name, case, fine, jail, judge }
end)

-- Config.MDT.Justice.ArrestEvent = 'myjail:arrest'
AddEventHandler('myjail:arrest', function(data)
    -- data = { person, character, source, name, fine, jail, bail, officer }
end)

#Railroad

Rail.Tiles holds the four tiles of the railroad page (icon, color, title, meta). They only show information for now.

apps/mdt/config_server.lua holds the app's Logs settings.