Exports
ARS Ambulance provides exports and events for integration with other resources.
Server Exports
Section titled “Server Exports”ReviveSelectedPlayer
Section titled “ReviveSelectedPlayer”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) endend)DiagnoseInjuredPerson
Section titled “DiagnoseInjuredPerson”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))endClient Exports
Section titled “Client Exports”isPlayerDead
Section titled “isPlayerDead”Check if a player is currently dead or in last stand.
---@param serverId? number---@return booleanexports['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")endDiagnoseInjuredPerson
Section titled “DiagnoseInjuredPerson”Diagnose a nearby injured player and display injury report.
exports['ars_ambulance']:DiagnoseInjuredPerson()Example:
exports['ars_ambulance']:DiagnoseInjuredPerson()ReviveSelectedTarget
Section titled “ReviveSelectedTarget”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
HealSelectedTarget
Section titled “HealSelectedTarget”Heal the closest injured player (or self) using medikit.
exports['ars_ambulance']:HealSelectedTarget()useSedative
Section titled “useSedative”Sedate the closest player.
exports['ars_ambulance']:useSedative()PlaceInVehicle
Section titled “PlaceInVehicle”Place the closest player into a vehicle or remove from stretcher.
exports['ars_ambulance']:PlaceInVehicle()ToggleStretcher
Section titled “ToggleStretcher”Deploy or interact with a stretcher from an ambulance.
exports['ars_ambulance']:ToggleStretcher()IsOnStretcher
Section titled “IsOnStretcher”Check if a player is currently on a stretcher.
---@param playerId number---@return booleanexports['ars_ambulance']:IsOnStretcher(playerId)LoadStretcherIntoVehicle
Section titled “LoadStretcherIntoVehicle”Load the deployed stretcher into the nearest ambulance vehicle.
exports['ars_ambulance']:LoadStretcherIntoVehicle()UnloadStretcherFromVehicle
Section titled “UnloadStretcherFromVehicle”Unload the stretcher from the ambulance vehicle.
exports['ars_ambulance']:UnloadStretcherFromVehicle()LoadStretcherObject
Section titled “LoadStretcherObject”Load the stretcher prop object (internal use).
exports['ars_ambulance']:LoadStretcherObject()OpenOutfitSelectionMenu
Section titled “OpenOutfitSelectionMenu”Open the uniform/clothing selection menu for EMS personnel.
exports['ars_ambulance']:OpenOutfitSelectionMenu()ProvideMedicalTreatment
Section titled “ProvideMedicalTreatment”Open the medical treatment menu for diagnosing and treating patients.
exports['ars_ambulance']:ProvideMedicalTreatment()Wheelchair and Crutch Exports
Section titled “Wheelchair and Crutch Exports”OpenCrutchMenu
Section titled “OpenCrutchMenu”Open the crutch interaction menu.
exports['ars_ambulance']:OpenCrutchMenu()RemoveCrutch
Section titled “RemoveCrutch”Remove crutch from the player.
exports['ars_ambulance']:RemoveCrutch()SetCrutchTime
Section titled “SetCrutchTime”Set the crutch duration in minutes.
exports['ars_ambulance']:SetCrutchTime(time)Parameters:
time(number) - Duration in minutes
OpenChairMenu
Section titled “OpenChairMenu”Open the wheelchair interaction menu.
exports['ars_ambulance']:OpenChairMenu()RemoveChair
Section titled “RemoveChair”Remove wheelchair from the player.
exports['ars_ambulance']:RemoveChair()SetChairTime
Section titled “SetChairTime”Set the wheelchair duration in minutes.
exports['ars_ambulance']:SetChairTime(time)Parameters:
time(number) - Duration in minutes
Server Callbacks
Section titled “Server Callbacks”ars_ambulance:isPlayerDead
Section titled “ars_ambulance:isPlayerDead”Check if a player is dead.
local isDead = lib.callback.await('ars_ambulance:isPlayerDead', 500, serverId)ars_ambulance:diagnoseInjuryOfPerson
Section titled “ars_ambulance:diagnoseInjuryOfPerson”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
ars_ambulance:getDeathPos
Section titled “ars_ambulance:getDeathPos”Get death coordinates of a player.
local coords = lib.callback.await('ars_ambulance:getDeathPos', 500, playerId)Returns: vector3 - Death coordinates
ars_ambulance:checkDeath
Section titled “ars_ambulance:checkDeath”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.
ars_ambulance:itemCheck
Section titled “ars_ambulance:itemCheck”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
ars_ambulance:removeItemFromPlayer
Section titled “ars_ambulance:removeItemFromPlayer”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
ars_ambulance:ProvideItemToPlayer
Section titled “ars_ambulance:ProvideItemToPlayer”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
ars_ambulance:getPlayerNames
Section titled “ars_ambulance:getPlayerNames”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.
ars_ambulance:getPlayerCoords
Section titled “ars_ambulance:getPlayerCoords”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.
ars_ambulance:loadLastSavedOutfit
Section titled “ars_ambulance:loadLastSavedOutfit”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.
ars_ambulance:reserveHospitalBed
Section titled “ars_ambulance:reserveHospitalBed”Reserve a hospital bed for a patient.
success = lib.callback.await('ars_ambulance:reserveHospitalBed', 1000, hospitalId, bedIndex, targetId)Parameters:
hospitalId(string) - Hospital location identifierbedIndex(number) - Bed index in hospitaltargetId(number) - Player ID to reserve for
Returns: boolean - True if bed was successfully reserved
ars_ambulance:retrievePlayerData
Section titled “ars_ambulance:retrievePlayerData”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
ars_ambulance:fetchCurrentTime
Section titled “ars_ambulance:fetchCurrentTime”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)Client Events
Section titled “Client Events”ars_ambulance:resetPlayerStatus
Section titled “ars_ambulance:resetPlayerStatus”Reset all player status effects (called on revive/check-in).
TriggerEvent('ars_ambulance:resetPlayerStatus')Server Events
Section titled “Server Events”ars_ambulance:revivePlayer
Section titled “ars_ambulance:revivePlayer”Revive a player.
TriggerClientEvent('ars_ambulance:revivePlayer', targetId)ars_ambulance:updatePlayerDeathStatus
Section titled “ars_ambulance:updatePlayerDeathStatus”Update player’s death status.
TriggerServerEvent('ars_ambulance:updatePlayerDeathStatus', status, shouldLog)ars_ambulance:resetPlayerThirstHunger
Section titled “ars_ambulance:resetPlayerThirstHunger”Reset player’s thirst and hunger (QBCore).
TriggerServerEvent('ars_ambulance:resetPlayerThirstHunger')State Bags
Section titled “State Bags”Player States
Section titled “Player States”| State | Type | Description |
|---|---|---|
Player(playerId).state.isDead | boolean | True if dead or in last stand |
Player(playerId).state.inLastStand | boolean | True if in last stand mode |
Player(playerId).state.onStretcher | boolean/netId | Stretcher net ID or false |
Global States
Section titled “Global States”| State | Type | Description |
|---|---|---|
GlobalState.HospitalBeds | table | Hospital bed occupancy status |
Example:
local isDead = Player(playerId).state.isDeadlocal inLastStand = Player(playerId).state.inLastStandBackward Compatibility
Section titled “Backward Compatibility”ARS Ambulance provides compatibility for existing resources:
-- esx_ambulancejob compatibilityexports['esx_ambulancejob']:Revive(targetId)
-- qb-ambulancejob compatibilityexports['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.