Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions hh_aidoc[QB]/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ local test = nil
local test1 = nil
local spam = true




RegisterCommand("help", function(source, args, raw)
if (QBCore.Functions.GetPlayerData().metadata["isdead"]) or (QBCore.Functions.GetPlayerData().metadata["inlaststand"]) and spam then
Expand All @@ -31,10 +29,9 @@ RegisterCommand("help", function(source, args, raw)
end)



function SpawnVehicle(x, y, z)
spam = false
local vehhash = GetHashKey("ambulance")
local vehhash = GetHashKey("jeep") --- custom gta 5 mod https://www.gta5-mods.com/vehicles/2016-ford-explorer-fpiu-qrv-saems-els
local loc = GetEntityCoords(PlayerPedId())
RequestModel(vehhash)
while not HasModelLoaded(vehhash) do
Expand All @@ -44,17 +41,18 @@ function SpawnVehicle(x, y, z)
while not HasModelLoaded('s_m_m_doctor_01') do
Wait(1)
end
local spawnRadius = 40
local spawnRadius = 300
local found, spawnPos, spawnHeading = GetClosestVehicleNodeWithHeading(loc.x + math.random(-spawnRadius, spawnRadius), loc.y + math.random(-spawnRadius, spawnRadius), loc.z, 0, 3, 0)

if not DoesEntityExist(vehhash) then
mechVeh = CreateVehicle(vehhash, spawnPos, spawnHeading, true, false)
ClearAreaOfVehicles(GetEntityCoords(mechVeh), 5000, false, false, false, false, false);
SetVehicleOnGroundProperly(mechVeh)
SetVehicleNumberPlateText(mechVeh, "HHFW")
SetVehicleNumberPlateText(mechVeh, "EMS")
SetEntityAsMissionEntity(mechVeh, true, true)
SetVehicleEngineOn(mechVeh, true, true, false)

SetVehicleSiren(mechVeh, true)

mechPed = CreatePedInsideVehicle(mechVeh, 26, GetHashKey('s_m_m_doctor_01'), -1, true, false)

mechBlip = AddBlipForEntity(mechVeh)
Expand All @@ -80,7 +78,7 @@ Citizen.CreateThread(function()
local ld = GetEntityCoords(test1)
local dist = Vdist(loc.x, loc.y, loc.z, lc.x, lc.y, lc.z)
local dist1 = Vdist(loc.x, loc.y, loc.z, ld.x, ld.y, ld.z)
if dist <= 10 then
if dist <= 20 then -- old was 10
if Active then
TaskGoToCoordAnyMeans(test1, loc.x, loc.y, loc.z, 1.0, 0, 0, 786603, 0xbf800000)
end
Expand Down Expand Up @@ -114,9 +112,9 @@ function DoctorNPC()
StopScreenEffect('DeathFailOut')
Notify("Your treatment is done, you were charged: "..Config.Price, "success")
RemovePedElegantly(test1)
Wait(30000) --5000
DeleteEntity(test)
Wait(5000)
DeleteEntity(test1)
--DeleteEntity(test1)
spam = true
end)
end
Expand Down
4 changes: 2 additions & 2 deletions hh_aidoc[QB]/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
Config = {}

Config.Doctor = 0 -- Minimum Amount of EMS to work
Config.Price = 2000
Config.ReviveTime = 20000 --in msec
Config.Price = 198.99
Config.ReviveTime = 15000 --in msec