diff --git a/resources/[jobs]/[medic]/mh_Teddy/client/function.lua b/resources/[jobs]/[medic]/mh_Teddy/client/function.lua index c8c166fb7..e65ab3e04 100644 --- a/resources/[jobs]/[medic]/mh_Teddy/client/function.lua +++ b/resources/[jobs]/[medic]/mh_Teddy/client/function.lua @@ -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 \ No newline at end of file