qbx_ambulancejob
local function alertAmbulance(src, text)
local ped = GetPlayerPed(src)
local coords = GetEntityCoords(ped)
local players = exports.qbx_core:GetQBPlayers()
local playerProperty = exports['vms_housing']:GetPlayerCurrentProperty(source)
if playerProperty then
local property = exports['vms_housing']:GetProperty(playerProperty)
if property.object_id then
local building = exports['vms_housing']:GetProperty(property.object_id)
if building.type == 'building' then
property = building
end
end
if property.metadata?.exit then
coords = property.metadata.exit
end
end
for _, v in pairs(players) do
if v.PlayerData.job.type == 'ems' and v.PlayerData.job.onduty then
TriggerClientEvent('hospital:client:ambulanceAlert', v.PlayerData.source, coords, text)
end
end
endlocal function respawn(src)
local player = exports.qbx_core:GetPlayer(src)
exports['vms_housing']:DropPlayerFromProperty(src)
-- Rest of the code
endLast updated
Was this helpful?