1
0
Fork 0
forked from Simnation/Main

Update function.lua

This commit is contained in:
Miho931 2025-07-02 21:00:45 +02:00
parent 5c05731d0e
commit d8f0117f9a

View file

@ -23,7 +23,7 @@ function spawnDoctor(coords, heading)
local ped = CreatePed(0, Config.DoctorModel, coords.x, coords.y, coords.z, heading or 0.0, true, true)
SetEntityAsMissionEntity(ped, true, true)
SetBlockingOfNonTemporaryEvents(ped, true)
SetEntityInvincible(ped, true) -- Unsterblich (kein Schaden möglich)
SetEntityCanBeDamaged(ped, false) -- Kein Schaden erleiden
SetPlayerCanTargetEntity(ped, false) -- Kann nicht angegriffen werden
@ -89,11 +89,11 @@ function HealPlayerWithARE(ped)
end
function IsAnyMedicOnDuty()
local players = QBCore.Functions.GetQBPlayers()
for _, player in pairs(players) do
if player.PlayerData.job.name == 'ambulance' and player.PlayerData.job.onduty then
return true
end
local Players, Amount = QBCore.Functions.GetPlayersOnDuty('ambulance')
if Amount > 0 then
return true
else
return false
end
return false
end