forked from Simnation/Main
Dr Teddy - Check Ambulance OnDuty
This commit is contained in:
parent
1c4711dbfd
commit
ac4e7be241
3 changed files with 17 additions and 18 deletions
|
@ -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
|
||||||
|
|
|
@ -86,15 +86,4 @@ function HealPlayerWithARE(ped)
|
||||||
ResetPedVisibleDamage(ped)
|
ResetPedVisibleDamage(ped)
|
||||||
ClearTimecycleModifier()
|
ClearTimecycleModifier()
|
||||||
ClearExtraTimecycleModifier()
|
ClearExtraTimecycleModifier()
|
||||||
end
|
|
||||||
|
|
||||||
function IsAnyMedicOnDuty()
|
|
||||||
local Players, Amount = QBCore.Functions.GetPlayersOnDuty('ambulance')
|
|
||||||
print(json.encode(Players))
|
|
||||||
|
|
||||||
if Amount > 0 then
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
end
|
|
@ -42,4 +42,14 @@ QBCore.Functions.CreateCallback("drteddy:checkMoney", function(source, cb)
|
||||||
else
|
else
|
||||||
cb({status = false, type = 'noPlayer'})
|
cb({status = false, type = 'noPlayer'})
|
||||||
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)
|
end)
|
Loading…
Add table
Add a link
Reference in a new issue