Skip to content

Exports

ARS Ambulance provides exports and events for integration with other resources.

Revive a specific player by server ID.

exports['ars_ambulance']:ReviveSelectedPlayer(targetServerId)

Parameters:

  • targetServerId (number) - Server ID of player to revive

Example:

RegisterCommand('reviveplayer', function(source, args)
local target = tonumber(args[1])
if target then
exports['ars_ambulance']:ReviveSelectedPlayer(target)
end
end)

Diagnose a specific player by server ID and get their injury data.

exports['ars_ambulance']:DiagnoseInjuredPerson(targetServerId)

Parameters:

  • targetServerId (number) - Server ID of player to diagnose

Returns: table|string|false - Injury data table, single injury type string, or false if no injuries

Example:

local injuries = exports['ars_ambulance']:DiagnoseInjuredPerson(targetId)
if injuries then
print("Player has injuries:", json.encode(injuries))
end

Check if a player is currently dead or in last stand.

---@param serverId? number
---@return boolean
exports['ars_ambulance']:isPlayerDead(serverId)

Parameters:

  • serverId (number, optional) - Player to check. If omitted, checks local player.

Returns: boolean - True if player is dead/in last stand

Example:

local isDead = exports['ars_ambulance']:isPlayerDead()
if isDead then
print("Player is dead")
end

Diagnose a nearby injured player and display injury report.

exports['ars_ambulance']:DiagnoseInjuredPerson()

Example:

exports['ars_ambulance']:DiagnoseInjuredPerson()

Revive the closest dead/injured player using defibrillator.

exports['ars_ambulance']:ReviveSelectedTarget()

Requirements:

  • Player must have defibrillator item
  • Target must be within 3.0 units

Heal the closest injured player (or self) using medikit.

exports['ars_ambulance']:HealSelectedTarget()

Sedate the closest player.

exports['ars_ambulance']:useSedative()

Place the closest player into a vehicle or remove from stretcher.

exports['ars_ambulance']:PlaceInVehicle()

Deploy or interact with a stretcher from an ambulance.

exports['ars_ambulance']:ToggleStretcher()

Check if a player is currently on a stretcher.

---@param playerId number
---@return boolean
exports['ars_ambulance']:IsOnStretcher(playerId)

Load the deployed stretcher into the nearest ambulance vehicle.

exports['ars_ambulance']:LoadStretcherIntoVehicle()

Unload the stretcher from the ambulance vehicle.

exports['ars_ambulance']:UnloadStretcherFromVehicle()

Load the stretcher prop object (internal use).

exports['ars_ambulance']:LoadStretcherObject()

Open the uniform/clothing selection menu for EMS personnel.

exports['ars_ambulance']:OpenOutfitSelectionMenu()

Open the medical treatment menu for diagnosing and treating patients.

exports['ars_ambulance']:ProvideMedicalTreatment()

Open the crutch interaction menu.

exports['ars_ambulance']:OpenCrutchMenu()

Remove crutch from the player.

exports['ars_ambulance']:RemoveCrutch()

Set the crutch duration in minutes.

exports['ars_ambulance']:SetCrutchTime(time)

Parameters:

  • time (number) - Duration in minutes

Open the wheelchair interaction menu.

exports['ars_ambulance']:OpenChairMenu()

Remove wheelchair from the player.

exports['ars_ambulance']:RemoveChair()

Set the wheelchair duration in minutes.

exports['ars_ambulance']:SetChairTime(time)

Parameters:

  • time (number) - Duration in minutes

Check if a player is dead.

local isDead = lib.callback.await('ars_ambulance:isPlayerDead', 500, serverId)

Get injury data for a player.

local injuries = lib.callback.await('ars_ambulance:diagnoseInjuryOfPerson', 1000, targetId)

Returns: table|string|false - Injury data, single injury type, or false

Get death coordinates of a player.

local coords = lib.callback.await('ars_ambulance:getDeathPos', 500, playerId)

Returns: vector3 - Death coordinates

Check if a player is dead from database/framework metadata.

local isDead = lib.callback.await('ars_ambulance:checkDeath', 500, targetId)

Returns: boolean - True if player is marked as dead

Use Case: Verify death status from persistent storage, not just current state.

Check if a player has a specific item in their inventory.

hasItem = lib.callback.await('ars_ambulance:itemCheck', 500, item)

Parameters:

  • item (string) - Item name to check

Returns: boolean - True if player has the item

Remove an item from a player’s inventory.

success = lib.callback.await('ars_ambulance:removeItemFromPlayer', 500, item)

Parameters:

  • item (string) - Item name to remove

Returns: boolean - True if item was successfully removed

Give an item to a player.

success = lib.callback.await('ars_ambulance:ProvideItemToPlayer', 500, item)

Parameters:

  • item (string) - Item name to give

Returns: boolean - True if item was successfully given

Get a list of all EMS player names.

playerNames = lib.callback.await('ars_ambulance:getPlayerNames', 500)

Returns: table - Mapping of player IDs to names

Use Case: Display lists of available EMS personnel for dispatch systems.

Get coordinates of all EMS players.

playerCoords = lib.callback.await('ars_ambulance:getPlayerCoords', 500)

Returns: table - Array of player data including coordinates

Use Case: GPS blips, dispatch systems, and EMS tracking.

Load a player’s last saved EMS outfit.

outfit = lib.callback.await('ars_ambulance:loadLastSavedOutfit', 1000)

Returns: table|false - Outfit data table or false if no saved outfit

Use Case: Quick uniform changes for EMS personnel.

Reserve a hospital bed for a patient.

success = lib.callback.await('ars_ambulance:reserveHospitalBed', 1000, hospitalId, bedIndex, targetId)

Parameters:

  • hospitalId (string) - Hospital location identifier
  • bedIndex (number) - Bed index in hospital
  • targetId (number) - Player ID to reserve for

Returns: boolean - True if bed was successfully reserved

Retrieve formatted player name data for wheelchair/crutch system.

playerData = lib.callback.await('ars_ambulance:retrievePlayerData', 500, data)

Parameters:

  • data (table) - Data to format

Returns: table - Formatted player data

Fetch remaining time for wheelchair/crutch assignment.

timeData = lib.callback.await('ars_ambulance:fetchCurrentTime', 500)

Returns: table - Object with chair, crutch, and time fields

Example:

local time = lib.callback.await('ars_ambulance:fetchCurrentTime', 500)
print("Chair time:", time.chair)
print("Crutch time:", time.crutch)
print("Total time:", time.time)

Reset all player status effects (called on revive/check-in).

TriggerEvent('ars_ambulance:resetPlayerStatus')

Revive a player.

TriggerClientEvent('ars_ambulance:revivePlayer', targetId)

Update player’s death status.

TriggerServerEvent('ars_ambulance:updatePlayerDeathStatus', status, shouldLog)

Reset player’s thirst and hunger (QBCore).

TriggerServerEvent('ars_ambulance:resetPlayerThirstHunger')

StateTypeDescription
Player(playerId).state.isDeadbooleanTrue if dead or in last stand
Player(playerId).state.inLastStandbooleanTrue if in last stand mode
Player(playerId).state.onStretcherboolean/netIdStretcher net ID or false
StateTypeDescription
GlobalState.HospitalBedstableHospital bed occupancy status

Example:

local isDead = Player(playerId).state.isDead
local inLastStand = Player(playerId).state.inLastStand

ARS Ambulance provides compatibility for existing resources:

-- esx_ambulancejob compatibility
exports['esx_ambulancejob']:Revive(targetId)
-- qb-ambulancejob compatibility
exports['qb-ambulancejob']:Revive(targetId)

Note: This guide is written by a third party. If you find any incorrect or outdated information, please contact us on Discord so we can update it for you.