1
0
Fork 0
forked from Simnation/Main
This commit is contained in:
Nordi98 2025-07-02 21:12:54 +02:00
commit f58e79824e
3 changed files with 18 additions and 18 deletions

View file

@ -15,13 +15,13 @@ CreateThread(function()
--show3DText(pos, "[E] Hilfe anfordern") --show3DText(pos, "[E] Hilfe anfordern")
DrawText3D(pos.x, pos.y, pos.z, "[E] Hilfe anfordern") DrawText3D(pos.x, pos.y, pos.z, "[E] Hilfe anfordern")
if IsControlJustPressed(0, 38) then if IsControlJustPressed(0, 38) then
local doc = IsAnyMedicOnDuty() QBCore.Functions.TriggerCallback('drteddy:ceckJob', function(cb)
Wait(100) if cb then
if doc then
TriggerServerEvent("drteddy:requestDoctor") TriggerServerEvent("drteddy:requestDoctor")
else else
Notify("Dr. Teddy", "Dr. Teddy ist grade nicht im Dienst, ruf den Notdienst", "inform") Notify("Dr. Teddy", "Dr. Teddy ist grade nicht im Dienst, ruf den Notdienst", "inform")
end end
end)
end end
end end
end end

View file

@ -87,13 +87,3 @@ function HealPlayerWithARE(ped)
ClearTimecycleModifier() ClearTimecycleModifier()
ClearExtraTimecycleModifier() ClearExtraTimecycleModifier()
end 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
end
return false
end

View file

@ -43,3 +43,13 @@ QBCore.Functions.CreateCallback("drteddy:checkMoney", function(source, cb)
cb({status = false, type = 'noPlayer'}) cb({status = false, type = 'noPlayer'})
end end
end) end)
QBCore.Functions.CreateCallback('drteddy:ceckJob', function(source, cb)
local Players, Amount = QBCore.Functions.GetPlayersOnDuty('ambulance')
if Amount > 0 then
cb(true)
else
cb(false)
end
end)