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["sky_jobs_base"]:createDispatch(
"Medical Emergency", -- title
"Caller reports an unconscious person requiring immediate medical assistance.", -- description
vector3(215.9, -810.2, 30.7), -- coords (vector3)
{ "ambulance", "firefighter" } -- jobs
)
Exports
revive(playerId, context?)
- Purpose: Revives the supplied player.
- Arguments:
playerId(number|string): The server ID of the player that should be revived.context(table?): Optional revive context.reason(string?): Controls post-revive behaviour."command"— Admin/force revive. Skips the death timeout (combat lockout)."txadmin_heal"— Same as"command"."heal_command"— Same as"command".nil/ omitted — Normal revive. Death timeout applies as configured.
- Returns:
boolean(truewhen the revive was triggered,falsefor an invalid or offline target).
-- Normal revive
exports["sky_ambulancejob"]:revive(playerId)
-- Admin revive (skips death timeout)
exports["sky_ambulancejob"]:revive(playerId, { reason = "command" })
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(truewhen the player is dead or downed,falseotherwise).
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:
tablewith: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
Salary
Pause or resume salary payouts for ambulance employees. These exports are provided by sky_jobs_base and work for all job types.
pausePlayerSalary(playerId)
- Purpose: Pauses salary payouts for the given player.
- Arguments:
playerId(number) — the server ID of the player.
- Returns:
boolean—trueon success.
resumePlayerSalary(playerId)
- Purpose: Resumes salary payouts for the given player.
- Arguments:
playerId(number) — the server ID of the player.
- Returns:
boolean—trueon success.
isPlayerSalaryPaused(playerId)
- Purpose: Checks whether salary payouts are currently paused.
- Arguments:
playerId(number) — the server ID of the player.
- Returns:
boolean—trueif paused.
-- Pause salary (e.g. when player is AFK)
exports["sky_jobs_base"]:pausePlayerSalary(playerId)
-- Resume salary (e.g. when player returns)
exports["sky_jobs_base"]:resumePlayerSalary(playerId)
-- Check if paused
local paused = exports["sky_jobs_base"]:isPlayerSalaryPaused(playerId)
See the Sky Jobs Base Server Exports for full documentation and usage examples.
Support
Need help? Our support team is always ready to assist
Join Discord