Browse docs

Server Exports

Server-side exports provided by the Sky Ambulancejob resource.

Dispatch

Create a dispatch for the MDT Tablet.

exports["sky_jobs_base"]:createDispatch(
    "Medical Emergency", -- title
    "Caller reports an unconscious person requiring immediate medical assistance.", -- description
    GetEntityCoords(PlayerPedId()), -- coords (vector3)
    { "ambulance", "firefighter" } -- jobs
)

Exports

revive(playerId)

  • Purpose: Revives the supplied player.
  • Arguments:
    • playerId (number|string): The server ID of the player that should be revived.
  • Returns: boolean (true when the revive was triggered, false for an invalid or offline target).
exports["sky_ambulancejob"]:revive(playerId)

isDead(playerId)

  • Purpose: Reports whether the specified player is currently flagged as dead by the ambulance job logic.
  • Arguments:
    • playerId (number|string): The server ID of the player whose state should be checked.
  • Returns: boolean (true when the player is dead or downed, false otherwise).
exports["sky_ambulancejob"]:isDead(playerId)

getStretcherModels()

  • Purpose: Returns the list of vehicle models configured as stretcher vehicles.
  • Returns: table — array of model hashes used for stretcher transport.
local models = exports["sky_ambulancejob"]:getStretcherModels()

calculateInsuranceCopay(playerId, billAmount)

  • Purpose: Calculates how much a patient would pay for a given bill amount, taking their active health insurance into account. If the player has no insurance or insurance is disabled, the full bill amount is returned.
  • Arguments:
    • playerId (number): The server ID of the player whose insurance should be checked.
    • billAmount (number): The original bill amount in dollars.
  • Returns: table with:
    • copayAmount (number) — The amount the patient pays after insurance.
    • originalAmount (number) — The original bill amount passed in.
    • hasInsurance (boolean) — Whether the player has active insurance.
    • provider (table?) — Insurance provider details (only when insured):
      • id (string) — Provider ID (e.g. "standard_care").
      • label (string) — Display name (e.g. "Standard Care").
      • copayPercent (number) — The percentage the patient pays (e.g. 30).
-- Example: Patient with "Standard Care" (30% copay) and a $900 bill
local result = exports["sky_ambulancejob"]:calculateInsuranceCopay(playerId, 900)

print(result.copayAmount)   -- 270 (patient pays 30%)
print(result.originalAmount) -- 900
print(result.hasInsurance)   -- true
print(result.provider.label) -- "Standard Care"

-- Example: Patient without insurance
local result = exports["sky_ambulancejob"]:calculateInsuranceCopay(playerId, 900)

print(result.copayAmount)   -- 900 (full amount)
print(result.hasInsurance)   -- false

Support

Need help? Our support team is always ready to assist

Join Discord