Kartik Scripts

Server Exports

All calls take a server source unless stated otherwise.

❤️ Life & death

exports['kartik-ambulancejob']:RevivePlayer(source, full)
exports['kartik-ambulancejob']:HealPlayer(source, full)
exports['kartik-ambulancejob']:KillPlayer(source)

full = true heals everything. Otherwise the player is stabilised with their injuries intact.


🔍 Player state

exports['kartik-ambulancejob']:IsDead(source)
exports['kartik-ambulancejob']:IsLastStand(source)
exports['kartik-ambulancejob']:IsDown(source)      -- dead OR last stand
exports['kartik-ambulancejob']:GetPlayerState(source)
exports['kartik-ambulancejob']:GetPatientVitals(source)

🩸 Applying injuries

exports['kartik-ambulancejob']:ApplyInjury(source, 'larm', { bleeding = 2, fracture = 1 })
exports['kartik-ambulancejob']:ApplyDamage(source, 'gunshot', 'chest', 35)

ApplyInjury sets exact severities on a body part. ApplyDamage runs real damage through the injury rules, class, zone, amount, so the result is randomised the way a real hit would be.

Zones: head · neck · chest · abdomen · larm · rarm · lleg · rleg


🦠 Diseases & restrictions

exports['kartik-ambulancejob']:GiveDisease(source, 'influenza')
exports['kartik-ambulancejob']:CureDisease(source, id)
exports['kartik-ambulancejob']:SetRestriction(source, 'rest', 10)   -- 10 minutes

🚑 Medics

exports['kartik-ambulancejob']:GetOnDutyMedics()    -- everyone clocked in
exports['kartik-ambulancejob']:GetAvailableMedics() -- those not down themselves
exports['kartik-ambulancejob']:GetMedicCount()
exports['kartik-ambulancejob']:IsMedic(source)

Also available as global state, with no export call:

GlobalState['kaj:medics']        -- available medics
GlobalState['kaj:medicsOnDuty']  -- clocked in

🦴 Impairment

exports['kartik-ambulancejob']:IsImpaired(source, 'carry')

Accepts 'carry', 'drag', 'cpr' or 'stretcher'. Broken arms block them.


📋 Medical records, for MDT / CAD

exports['kartik-ambulancejob']:GetLatestMedicalReport(citizenid)
exports['kartik-ambulancejob']:GetMedicalHistory(citizenid, limit)
exports['kartik-ambulancejob']:GetPrescriptions(citizenid, activeOnly)
exports['kartik-ambulancejob']:GetMedicalProfile(citizenid)

A report contains:

Field
summaryPlain text, ready to paste
injuriesEvery injury found
treatmentsEverything applied
medicationsEvery drug given
proceduresCPR, defibrillation, surgery, transfusions
testsScans and lab results
diagnosesConfirmed illnesses
prescriptionsAnything written
vitals.initial / vitals.finalHow they arrived and how they left
dispositionFit, rest, crutches, wheelchair
notesThe medic's notes

This is what "Import medical data" in an MDT should call.

Verifying a medical certificate

Every signed certificate carries a verification code printed on the paper (K7QM-29XF). Police MDTs, employers and DMV scripts can check it:

local cert = exports['kartik-ambulancejob']:VerifyCertificate('K7QM-29XF')

Returns nil when no certificate has that code. Dashes, spaces and case don't matter. Otherwise:

Field
status'valid', 'expired' or 'revoked', worked out live
certificateThe template name, e.g. Fitness Certificate
patient / identifierWho it was issued to
doctor / hospitalWho signed it, and where
issuedAt / expiresAtUnix timestamps (expiresAt is nil for no expiry)
revoked{ by, at, reason } when revoked
code / idThe code and the medical record ID

💉 Drugs & addiction

exports['kartik-ambulancejob']:RegisterAddictiveDrug('oxy', {
    class = 'opioid',
    addiction = { type = 'opioid', gain = 20 },
    overdose = { doses = 3, window = 900, disease = 'opioid_overdose' },
})

exports['kartik-ambulancejob']:RegisterAddiction('meth', {
    label = 'Meth Dependence',
    threshold = 50,
    withdrawal = { { after = 0, symptoms = { 'shaking', 'panic' } } },
    relievedBy = { 'stimulant' },
})

exports['kartik-ambulancejob']:RecordDrugUse(source, 'oxy')
exports['kartik-ambulancejob']:IsAddictiveDrug('oxy')
exports['kartik-ambulancejob']:GetPlayerAddictions(source)
exports['kartik-ambulancejob']:ClearPlayerAddiction(source, 'opioid')  -- nil clears all
exports['kartik-ambulancejob']:IsPlayerOverdosing(source)

Full guide: Addictions & Overdoses.


🍺 Alcohol

exports['kartik-ambulancejob']:AddBac(source, 0.02)

Or via event:

TriggerEvent('kartik-ambulancejob:server:drink', source, 0.02)

🏥 Envi-Medic

exports['kartik-ambulancejob']:EnviRevive(source, finalRevive)

Put this in envi-medic's config as its revive call. finalRevive = true heals fully.

On this page