Features
Health
The Health app's Medical ID, medical history and medic tools.
The Health app has two sides.
| Side | What it is |
|---|---|
| Activity | Steps, distance, floors, calories, the three rings, awards and trends, counted from how the character moves |
| Medical ID | Who the character is medically, and their medical history |
This page is about the second one. Both are switched with Config.Health.
#Medical ID
A card every character has. Part of it comes from the character and cannot be edited on the phone; the rest is the player's own to fill in.
| From the character | Filled in by the player |
|---|---|
| Name | Height and weight |
| Birth date and age | Allergies |
| Gender | Medical conditions |
| Blood type | Medications |
| Emergency contacts (up to 3, picked from Contacts) | |
| Organ donor | |
| Notes for medics |
The app also shows:
- Body: health, armour, and (where the framework counts them) hunger, thirst and stress, live. A reading in the red pulses.
- Body mass index, worked out from height and weight.
- Blood compatibility: which blood types this one can receive from and give to.
- Emergency contacts with a call button.
#Where the blood type comes from
- QBCore and Qbox give every character a blood type when it is created. The phone shows that one, the same value the admin panel shows. It cannot be changed on the phone.
- Other frameworks have none. The phone gives each character a blood type the first time it is needed, in realistic shares (O+ and A+ are common, AB- is rare), and keeps it. The player can correct it in the app.
The blood type is also printed on the ID card and the licences in Wallet. Config.Wallet.ShowBloodType = false takes it off the cards.
#Show in an Emergency
A switch on the Medical ID. On (the default), a medic standing next to the player can open their Medical ID. Off, it stays shut for everyone, except when a script opens it (see ShowMedicalId below).
#Medical history
A timeline of records: treatments, diagnoses, surgeries, prescriptions, vaccines, lab tests, check-ups, injuries and revivals. Each has a title, the doctor, the facility, a severity and the date; a record can also carry details, a cost and readings such as heart rate or blood pressure.
- Players read their history. They cannot add to it or delete from it.
- Records are written by medics from their phone, and by other scripts through
AddMedicalRecord. - The patient gets a notification for every new record.
- Prescriptions show how many days they have left, and the valid ones are listed at the top.
- A character keeps the newest
MaxRecordsrecords.
#Medics
Players whose job is listed in Config.Health.MedicJobs get a Scan for Patients button in the Health app.
- The scan lists the people within
ScanRangemetres, without names. - Picking one opens their Medical ID, if they allow it.
- The medic sees the patient's history and can add a record: the type, a title, details, the severity, and for a prescription how many days it runs.
The record is signed with the medic's name and their job. It cannot be edited or deleted from the phone.
#Options
luaConfig.Health = {
Enabled = true,
KeepDays = 30,
Goals = { move = 400, exercise = 30, stand = 12, steps = 8000 },
MedicJobs = { 'ambulance', 'lsms', 'ssms' }, -- set to your server's medic jobs
Medical = {
Enabled = true,
ScanRange = 4.0,
MedicsNeedDuty = false,
NotifyPatient = true,
MaxRecords = 200,
},
}
| Option | What it does |
|---|---|
Enabled |
Switches the Health app's server side on |
KeepDays |
Days of daily activity kept per character |
Goals |
The daily goals behind the rings: move, exercise, stand, steps |
MedicJobs |
Jobs that can scan for patients and write records. Set it to your server's medic jobs |
Medical.Enabled |
Switches the Medical ID and the records off, leaving the activity side |
Medical.ScanRange |
How close a medic has to stand, in metres |
Medical.MedicsNeedDuty |
Only medics who are on duty count |
Medical.NotifyPatient |
A notification on the patient's phone for every new record |
Medical.MaxRecords |
Records kept per character |
#Connecting an ambulance job
Three calls cover most of it. All exports are in Server exports: health.
A medic checks someone who is down. Open the patient's Medical ID on the medic's phone:
luaexports['fx-phone']:ShowMedicalId(medicSource, patientSource)
A treatment is finished. Write it into the patient's history:
luaexports['fx-phone']:AddMedicalRecord(patientSource, {
kind = 'treatment',
title = 'Gunshot wound, left arm',
details = 'Bullet removed, six stitches.',
doctor = doctorName,
facility = 'Pillbox Hospital',
severity = 3,
cost = 1850,
})
Someone is revived.
luaexports['fx-phone']:AddMedicalRecord(patientSource, { kind = 'revive', title = 'Revived at the scene', doctor = medicName, severity = 4 })
A blood transfusion needs the type.
lualocal blood = exports['fx-phone']:GetBloodType(patientSource)