Browse docs
Player State and Revive
Exports
killPlayer(playerId, customReason?)
Sends a kill request to the specified player's ambulance death flow. Use an optional custom reason for integrations such as overdose systems.
local sent = exports["sky_ambulancejob"]:killPlayer(playerId, "Overdose")
-- Keep the default forced-death reason:
local sentDefault = exports["sky_ambulancejob"]:killPlayer(playerId)
| Argument | Type | Description |
|---|---|---|
playerId | number | string | Positive integer server ID of an online player, or its numeric string. Local player indexes, ped handles and broadcast targets are not supported. |
customReason | string? | Optional localized plain text from your integration. Leading/trailing spaces are trimmed. Must contain 1–120 Unicode characters, valid UTF-8 and no ASCII control characters. |
Returns true when the targeted client event is sent; false for an invalid/offline player or invalid reason. true does not confirm that the player died: the client's spawn-readiness, damage protection and death hooks still apply. Call this from a trusted server resource instead of killing the ped separately first.
The custom text appears in the paramedic diagnosis view while the patient is unconscious and on the death screen when cause information is enabled. It clears on revival. Omitting the reason or passing nil preserves the existing suicide reason. Custom text does not change injuries or treatment rules. See Client Exports for the local-player version.
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" })
setGodmode(playerId, enabled)
- Purpose: Enables or disables damage protection for the supplied player through a server-authoritative export.
- Arguments:
playerId(number|string): The server ID of the player.enabled(boolean):trueenables Godmode;falsedisables it.
- Returns:
boolean(truewhen the state was applied,falsefor an invalid or offline target).
-- Enable Godmode
exports["sky_ambulancejob"]:setGodmode(playerId, true)
-- Disable Godmode
exports["sky_ambulancejob"]:setGodmode(playerId, false)
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)
getDeathState(playerId)
- Purpose: Returns the server-authoritative death snapshot for the specified player, including phase, bleed-out timer, action availability, AI Medic state, and detected cause.
- Arguments:
playerId(number|string): The server ID of the player whose state should be read.
- Returns:
table|nil— the death snapshot, ornilfor an invalid or offline player.
local state = exports["sky_ambulancejob"]:getDeathState(playerId)
See External Death Screen for the complete integration flow, state fields, client actions, and security requirements.
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()