Client Exports
REMEMBER ABOUT CLIENT SIDE AND SERVER SIDE IN CHOOSING EXPORT!
Revive Player
Use one of following events to revive player
-- Any of these events will work :)
TriggerEvent('p_ambulancejob/client/death/revive')
TriggerEvent('esx_ambulancejob:revive')
TriggerEvent('hospital:client:RevivePlayer')
TriggerEvent('hospital:client:Revive')
Kill Player
Use one of following events to kill player
-- Any of these events will work :)
TriggerEvent('p_ambulancejob/client/death/kill')
TriggerEvent('hospital:client:KillPlayer')
openDispatch
Use following export to open dispatch menu
exports['p_ambulancejob']:openDispatch()
openDispatch
Use following export to open dispatch menu
exports['p_ambulancejob']:openDispatch()
getDispatchAlerts
Use following export to get all active alerts on dispatch
exports['p_ambulancejob']:getDispatchAlerts()
Return:
alerts:
table {id: number, player: number, code: string, title: string, message: string, coords: vec3, expire: number, blip: {sprite: number, scale: number, color: number}}
Send Alert
Use following event to send alert to EMS
TriggerServerEvent('p_ambulancejob/server/alerts/new', {
code = '911',
title = 'Alert',
message = 'I need help!',
coords = GetEntityCoords(PlayerPedId()),
expire = 60, -- 60 seconds
blip = {
sprite = 153,
color = 1,
scale = 1.1,
pulse = true
}
})
code: string
Alert Code
title: string
Alert Title
message: string
Alert Message
coords: vec3
Coords of alert
expire: number
Time in seconds to expire alert
blip: {sprite: number, color: number, scale: number, pulse: boolean}
isPlayerOnBed
Use following export to check if player is currently on some hospital bed
local targetId = 1 -- replace with existing player id
local result = exports['p_ambulancejob']:isPlayerOnBed(targetId)
print(result) -- true / false
playerId: number
Existing player server id
Return:
result:
boolean
getBleedingValue
Use following export to check player current bleeding value
local result = exports['p_ambulancejob']:getBleedingValue()
print(result) -- number
Return:
result:
number
stopBleeding
Use following export to stop player bleeding
exports['p_ambulancejob']:stopBleeding()
addBleeding
Use following export to add value to player bleeding
local value = 5
exports['p_ambulancejob']:addBleeding(value)
value: number
Value to add
removeBleeding
Use following export to remove value from player bleeding
local value = 5
exports['p_ambulancejob']:removeBleeding(value)
value: number
Value to remove
isCrutchEnabled
Use following export to check if player has currently enabled crutch
local result = exports['p_ambulancejob']:isCrutchEnabled()
print(result) -- true / false
Return:
result:
boolean
getDeathInfo
Use following export to check player death info
local result = exports['p_ambulancejob']:getDeathInfo()
print(result.isDead, result.stage)
Return:
result:
{isDead: boolean, stage: "death" | "bleeding" | "recovering" | "none"}
isDead / dead
Use following state bag to check if player is dead
LocalPlayer.state.isDead
LocalPlayer.state.dead -- compatibility with other ambulance jobs
Player(targetId).state.isDead
Player(targetId).state.dead -- compatibility with other ambulance jobs
-- all of these state bags return true / false
LocalPlayer.state.deathType
Player(targetId).state.deathType
-- both of this return stage: "death" | "bleeding" | "recovering" | "none"
onDeathStateChange
You can use this event handler to follow players death state
RegisterNetEvent('p_ambulancejob/onDeathStateChange', function(deathType, deathData)
end)
deathType:
"death" | "bleeding" | "recovering" | "none"
deathData:
{victimCoords: vec3, killerCoords: vec3 | nil, distance: number | nil, killer: number | nil, cause: number, weapon: number, weaponLabel: string | nil}
isGpsActive
Use following export to check if player gps is active
local result = exports['p_ambulancejob']:isGpsActive()
print(result) -- true / false
Return:
result:
boolean
Check Pulse
Use following statebags to check player pulse
LocalPlayer.state.pulse -- number
LocalPlayer.state.criticalPulse -- true / false
local targetId = 2 -- replace with existing player id
Player(targetId).state.pulse -- number
Player(targetId).state.criticalPulse -- true / false
resetPulse
Use following export to reset player pulse
exports['p_ambulancejob']:resetPulse()
addPulse
Use following export to add value to player pulse
local value = 5
exports['p_ambulancejob']:addPulse(value)
value: number
Value to add
resetTemperature
Use following export to reset player temperature
exports['p_ambulancejob']:resetTemperature()
addTemperature
Use following export to add value to player temperature
local value = 5
exports['p_ambulancejob']:addTemperature(value)
value: number
Value to add
Last updated