1
0
Fork 0
forked from Simnation/Main
This commit is contained in:
Nordi98 2025-07-02 20:35:29 +02:00
commit 7bda9dd70b
3 changed files with 18 additions and 2 deletions

View file

@ -15,7 +15,13 @@ CreateThread(function()
--show3DText(pos, "[E] Hilfe anfordern")
DrawText3D(pos.x, pos.y, pos.z, "[E] Hilfe anfordern")
if IsControlJustPressed(0, 38) then
TriggerServerEvent("drteddy:requestDoctor")
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
end
end
end

View file

@ -79,3 +79,13 @@ function HealPlayerWithARE(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

View file

@ -81,7 +81,7 @@
* - "Direct": The radio system is based on the distance between the players.
* - "None": The radio always works no matter the distance.
*/
"mode": "Direct",
"mode": "None",
// The maximum distance between two players or to the tower to be able to hear each other.
"maxDistance": 5000
},