π₯οΈCode Snippets
Here are some examples of how you can integrate with specific scripts
QBCore: qb-ambulancejob custom checkin event
-- This will check the player into the hospital that they spawn near
-- The hospitalIndex provided by wp-ai-ems must match the index for the hospital locations defined in this script
RegisterNetEvent('qb-ambulancejob:aiems-checkin', function(hospitalIndex)
QBCore.Functions.Progressbar("hospital_checkin", Lang:t('progress.checking_in'), 2000, false, true, {
disableMovement = true,
disableCarMovement = true,
disableMouse = false,
disableCombat = true,
}, {}, {}, {}, function() -- Done
-- Gets a bed that is not occupied at this hospital to place the player in
local bedId = getClosestAvailableBed(hospitalIndex)
if bedId then
TriggerServerEvent("hospital:server:SendToBed", bedId, true, hospitalIndex)
hospitalLocation = hospitalIndex
-- HospitalOutfit() -- Optional if you have this defined
else
QBCore.Functions.Notify(Lang:t('error.beds_taken'), "error")
end
end)
end)PS-MDT: Dispatch AI EMS on downed person alerts from the MDT

Wasabi Ambulance Integration
Last updated