Skip to content

Права и Длительность

Permissions & Duration

"Self" always means the player's own body. Anything aimed at another player is treated as editing somebody else, and needs one of the configured jobs or the ACE.

Who may examine another player

config.lua
Config.Permissions = {
    EditOthers = { 'ambulance', 'ems', 'doctor' },
    MinGrade   = 0,
    UseAce     = false,
    Ace        = 'bupa.syncstatus',
    MaxDistance = 3.0,

    LockStaffNotes       = true,
    AllowSelfRemove      = true,
    StaffCanRemoveLocked = true,
}
Option Default Purpose
EditOthers { 'ambulance', 'ems', 'doctor' } Jobs allowed to annotate other players. Empty ({}) disables it entirely.
MinGrade 0 Minimum job grade for those jobs (0 = any grade).
UseAce false Also accept an ACE permission instead of a job, for admins.
Ace bupa.syncstatus The ACE object checked when UseAce is on.
MaxDistance 3.0 How close you must stand to examine somebody, in metres. 0 disables the check.

Every one of these is enforced on the server, on every single read, write and remove — not just when the panel opens.

Locked medic documentation

This is the option that makes the script worth running.

Option Default Effect
LockStaffNotes true An annotation a medic places on somebody else is locked. The patient cannot delete it; it goes away on its own when the timer ends.
AllowSelfRemove true May players remove annotations they placed on themselves?
StaffCanRemoveLocked true May authorised jobs take a locked note off before it expires? Turn off for truly immutable documentation.

A locked annotation is marked in the panel as "Locked by medic". Clear all and /statusclear deliberately keep locked notes: the server only deletes rows the caller is actually allowed to remove, and reports how many that was.

With LockStaffNotes = true and StaffCanRemoveLocked = false, nobody can remove a medic's note — not even the medic who wrote it. It will only vanish when its timer runs out, so avoid pairing that with permanent durations.

Duration

config.lua
Config.Duration = {
    Enabled         = true,
    Presets         = { 30, 60, 120, 180, 360, 720 },  -- minutes
    Default         = 120,
    AllowPermanent  = true,
    SelfDefault     = 0,     -- minutes; 0 = permanent
    CleanupInterval = 60,    -- seconds
}
  • Presets are rendered as one chip per entry in the panel, in minutes. Keep the list short.
  • Default is the chip pre-selected when a medic annotates a patient. A duration the server does not recognise is silently replaced with this value, so a tampered client cannot invent its own timer.
  • AllowPermanent adds a Permanent option next to the presets.
  • SelfDefault is used for notes players write on themselves — 0 means permanent.
  • CleanupInterval is how often the server sweeps expired rows out of the database and out of everybody's statebag. The minimum enforced value is 10 seconds.

Setting Enabled = false makes every annotation permanent until somebody removes it; the duration picker disappears from the panel and the sweep thread never starts.

Limits

config.lua
Config.Limits = {
    MaxPerPlayer   = 4,
    MaxTextLength  = 48,
    class="hljs-literal">true,
    WriteCooldown  = 2,   -- seconds between writes
}

Text is trimmed, stripped of <, > and ~, and cut to MaxTextLength on the server before it is stored, so nothing a player types can break the rendering.

Reading annotations from another resource

server
local list = exports['bupa-syncstatus']:GetStatuses(source)

Returns the cached list for that player: id, bodypart, text, type, severity, locked, expires and remaining. The same list is readable client-side from the statebag as Player(serverId).state.bupaStatuses.