Server exports

Help calls

The server export that leaves a help call for the doctors on duty, the same call the /yardim command makes.

A help call puts the player's position on the call list of the doctors on duty in the Resmi Defter app (mdt, doctor section). Doctors on duty get a notification and can take a route to the caller. Calls live in memory only and are not saved. The export is in apps/mdt/server/doctor.lua. Any resource may call it.

#HelpCall

Leaves a help call for src at the player's current position.

lua---@param src integer player server id
---@param text? string short description, up to 60 characters
---@return boolean ok
---@return integer|string doctorsOrReason doctors notified, or a reason the player can read
exports['fx-pocketbook']:HelpCall(src, text)
lua-- after the player is downed
local ok, info = exports['fx-pocketbook']:HelpCall(source, 'Shot near the river')
if ok and info == 0 then
    -- the call is on the list, but no doctor is on duty right now
end
  • An empty or missing text uses DefaultText.
  • If text contains one of SevereWords, the call is shown as severe.
  • A player has one open call at a time. A new call replaces the old one.
  • Doctors see only calls in their own routing bucket.

It returns false and a reason when:

  • src is not a player id (no reason is given then),
  • help calls are off (Enabled = false here or Config.MDT.Enabled = false),
  • the character is not loaded,
  • the same player called less than Cooldown seconds ago,
  • Max calls are already waiting,
  • the position cannot be read.

#Settings

apps/mdt/config.lua > Config.MDT.Doctor.Calls:

Key Default What it does
Enabled true Help calls on or off
Command 'yardim' Chat command that leaves a call (/yardim [text]). '' registers no command; only the export works then.
Cooldown 120 Seconds between two calls of the same player (at least 5)
ExpireMinutes 15 An unanswered call is dropped after this
Max 20 Calls that may wait at the same time
DefaultText 'Yardim cagrisi' Text used when none is given
SevereWords { 'vurul', 'kursun', 'bayil', 'olu', 'kan' } Words that mark a call as severe