Kartik Scripts

Logs & Security

shared/server/config.lua, server only, never sent to clients.

๐Ÿ“œ Logging

ServerConfig.Logs = {
    service = 'discord',   -- 'discord' | 'ox_lib' | 'both' | false
    name = 'Kartik EMS',
    avatar = '',
    webhooks = { ... },
}

A separate webhook per category, so you can route each one to the right channel:

WebhookLogs
defaultAnything without its own webhook
deathPlayers going down and dying
reviveRevives, by whom
treatmentTreatments and medications given
prescriptionPrescriptions issued and revoked
recordsRecord edits and deletions
billingBills sent and paid
adminEvery admin action
creatorHospital creator changes
aipatientsAI callouts taken and resolved
pagerEMS group channel messages
permadeathFinal kill approvals, kills and restores

Leave a webhook empty and it falls back to default.

Set service = 'ox_lib' to use whatever logger ox_lib is configured for in your convars, or 'both' to send to Discord and ox_lib at once.


๐Ÿ›ก๏ธ Anti-abuse

ServerConfig.Security = {
    maxInteractDistance = 6.0,
    treatmentCooldown = 1500,
    damageReportsPerSecond = 12,
    kickOnExploit = false,
}
Setting
maxInteractDistanceMaximum distance between medic and patient for any medical action. Server-enforced
treatmentCooldownMilliseconds between treatments from the same medic
damageReportsPerSecondRate limit on damage events from one client
kickOnExploitKick players who trigger protected events with invalid data

kickOnExploit is off by default because a badly behaved third-party resource can trip it. Turn it on once you are confident nothing legitimate is triggering it, and watch your logs first.

Client revive events

See General & Compatibility. By default legacy client revive events only work with an admin or on-duty medic within 10 m.


๐Ÿ—„๏ธ Database

ServerConfig.AutoDatabase = true
ServerConfig.RecordRetentionDays = false
AutoDatabaseCreates and migrates tables on start. Turn off only if your DB user cannot create tables, then import install/database.sql manually
RecordRetentionDaysDays to keep medical records. false = forever

See Database.


๐Ÿ”„ Version check

ServerConfig.VersionCheck = {
    enabled = true,
    url = '',
}

Point it at a URL returning either plain text:

1.2.0

or JSON:

{ "version": "1.2.0", "changelog": "Added the morgue system" }

The result is printed to your server console on start. Set enabled = false to skip the check entirely.

On this page