forked from Simnation/Main
Merge branch 'master' of https://git.evolution-state-life.de/Evolution-State-Life/Main
This commit is contained in:
commit
f58e79824e
3 changed files with 18 additions and 18 deletions
|
@ -15,13 +15,13 @@ CreateThread(function()
|
|||
--show3DText(pos, "[E] Hilfe anfordern")
|
||||
DrawText3D(pos.x, pos.y, pos.z, "[E] Hilfe anfordern")
|
||||
if IsControlJustPressed(0, 38) then
|
||||
local doc = IsAnyMedicOnDuty()
|
||||
Wait(100)
|
||||
if doc then
|
||||
TriggerServerEvent("drteddy:requestDoctor")
|
||||
else
|
||||
Notify("Dr. Teddy", "Dr. Teddy ist grade nicht im Dienst, ruf den Notdienst", "inform")
|
||||
end
|
||||
QBCore.Functions.TriggerCallback('drteddy:ceckJob', function(cb)
|
||||
if cb then
|
||||
TriggerServerEvent("drteddy:requestDoctor")
|
||||
else
|
||||
Notify("Dr. Teddy", "Dr. Teddy ist grade nicht im Dienst, ruf den Notdienst", "inform")
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
@ -86,14 +86,4 @@ function HealPlayerWithARE(ped)
|
|||
ResetPedVisibleDamage(ped)
|
||||
ClearTimecycleModifier()
|
||||
ClearExtraTimecycleModifier()
|
||||
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
|
|
@ -42,4 +42,14 @@ QBCore.Functions.CreateCallback("drteddy:checkMoney", function(source, cb)
|
|||
else
|
||||
cb({status = false, type = 'noPlayer'})
|
||||
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)
|
Loading…
Add table
Add a link
Reference in a new issue