diff --git a/client/hospital.lua b/client/hospital.lua index 38c9d0d..5837ecf 100644 --- a/client/hospital.lua +++ b/client/hospital.lua @@ -146,7 +146,7 @@ if config.useTarget then end, icon = 'fas fa-clipboard', label = locale('text.check'), - distance = 1.5, + distance = 3.0, } } }) @@ -167,7 +167,7 @@ if config.useTarget then end, icon = 'fas fa-clipboard', label = locale('text.bed'), - distance = 1.5, + distance = 3.0, }, { canInteract = function() @@ -182,7 +182,7 @@ if config.useTarget then end, icon = 'fas fa-clipboard', label = locale('text.put_bed'), - distance = 1.5, + distance = 3.0, } } }) diff --git a/client/job.lua b/client/job.lua index 261b28a..c7528a5 100644 --- a/client/job.lua +++ b/client/job.lua @@ -208,27 +208,6 @@ local function openArmory(armoryId, stashId) exports.ox_inventory:openInventory('shop', { type = sharedConfig.locations.armory[armoryId].shopType, id = stashId }) end ----While in the garage pressing a key triggers storing the current vehicle or opening spawn menu. ----@param vehicles AuthorizedVehicles ----@param coords vector4 -local function checkGarageAction(vehicles, coords) - checkVehicle = true - CreateThread(function() - while checkVehicle do - if IsControlJustPressed(0, 38) then - lib.hideTextUI() - checkVehicle = false - if cache.vehicle then - DeleteEntity(cache.vehicle) - else - showGarageMenu(vehicles, coords) - end - end - Wait(0) - end - end) -end - ---Teleports the player with a fade in/out effect ---@param coords vector3 | vector4 local function teleportPlayerWithFade(coords) @@ -278,14 +257,15 @@ local function createGarage(vehicles, coords) end end, onExit = function() - checkVehicle = false - lib.hideTextUI() + lib.hideTextUI() end, inside = function() - if QBX.PlayerData.job.type == 'ems' and QBX.PlayerData.job.onduty then - checkGarageAction(vehicles, coords) + if QBX.PlayerData.job.type == 'ems' and QBX.PlayerData.job.onduty and IsControlJustPressed(0, 38) then + if cache.vehicle then + DeleteEntity(cache.vehicle) else - checkVehicle = false + showGarageMenu(vehicles, coords) + end end end, }) diff --git a/client/laststand.lua b/client/laststand.lua index c3f3700..e55db74 100644 --- a/client/laststand.lua +++ b/client/laststand.lua @@ -45,11 +45,9 @@ RegisterNetEvent('hospital:client:HelpPerson', function(targetId) }, }) then - ClearPedTasks(cache.ped) exports.qbx_core:Notify(locale('success.revived'), 'success') TriggerServerEvent('hospital:server:RevivePlayer', targetId) else - ClearPedTasks(cache.ped) exports.qbx_core:Notify(locale('error.canceled'), 'error') end end) diff --git a/client/main.lua b/client/main.lua index 6472835..724a259 100644 --- a/client/main.lua +++ b/client/main.lua @@ -61,6 +61,10 @@ RegisterNetEvent('hospital:client:Revive', function() EmsNotified = false end) +RegisterNetEvent('qbx_medical:client:playerRevived', function() + EmsNotified = false +end) + ---Sends player phone email with hospital bill. ---@param amount number RegisterNetEvent('hospital:client:SendBillEmail', function(amount) diff --git a/client/setdownedstate.lua b/client/setdownedstate.lua index 2b0ff8a..b6d1e63 100644 --- a/client/setdownedstate.lua +++ b/client/setdownedstate.lua @@ -61,8 +61,6 @@ local function handleLastStand() qbx.drawText2d({ text = locale('info.bleed_out_help', math.ceil(laststandTime)), coords = vec2(1.0, 1.44), scale = 0.6 }) handleRequestingEms() end - - exports.qbx_medical:playLastStandAnimationDeprecated() end ---Set dead and last stand states. diff --git a/client/wounding.lua b/client/wounding.lua index ec854f6..8afeec4 100644 --- a/client/wounding.lua +++ b/client/wounding.lua @@ -20,7 +20,6 @@ lib.callback.register('hospital:client:UseIfaks', function() }, }) then - StopAnimTask(cache.ped, 'mp_suicide', 'pill', 1.0) TriggerServerEvent('hud:server:RelieveStress', math.random(12, 24)) SetEntityHealth(cache.ped, GetEntityHealth(cache.ped) + 10) OnPainKillers = true @@ -33,7 +32,6 @@ lib.callback.register('hospital:client:UseIfaks', function() end return true else - StopAnimTask(cache.ped, 'mp_suicide', 'pill', 1.0) exports.qbx_core:Notify(locale('error.canceled'), 'error') return false end @@ -58,7 +56,6 @@ lib.callback.register('hospital:client:UseBandage', function() }, }) then - StopAnimTask(cache.ped, 'anim@amb@business@weed@weed_inspecting_high_dry@', 'weed_inspecting_high_base_inspector', 1.0) SetEntityHealth(cache.ped, GetEntityHealth(cache.ped) + 10) if math.random(1, 100) < 50 then exports.qbx_medical:removeBleed(1) @@ -68,7 +65,6 @@ lib.callback.register('hospital:client:UseBandage', function() end return true else - StopAnimTask(cache.ped, 'anim@amb@business@weed@weed_inspecting_high_dry@', 'weed_inspecting_high_base_inspector', 1.0) exports.qbx_core:Notify(locale('error.canceled'), 'error') return false end @@ -93,7 +89,6 @@ lib.callback.register('hospital:client:UsePainkillers', function() }, }) then - StopAnimTask(cache.ped, 'mp_suicide', 'pill', 1.0) OnPainKillers = true exports.qbx_medical:DisableDamageEffects() if painkillerAmount < 3 then @@ -101,7 +96,6 @@ lib.callback.register('hospital:client:UsePainkillers', function() end return true else - StopAnimTask(cache.ped, 'mp_suicide', 'pill', 1.0) exports.qbx_core:Notify(locale('error.canceled'), 'error') return false end diff --git a/server/hospital.lua b/server/hospital.lua index 4e7bad4..69bb504 100644 --- a/server/hospital.lua +++ b/server/hospital.lua @@ -113,7 +113,7 @@ lib.callback.register('qbx_ambulancejob:server:canCheckIn', canCheckIn) ---@param patientSrc number the player being checked in ---@param hospitalName string name of the hospital matching the config where player should be placed local function checkIn(src, patientSrc, hospitalName) - if not canCheckIn(patientSrc, hospitalName) then return false end + if src == patientSrc and not canCheckIn(patientSrc, hospitalName) then return false end local bedIndex = getOpenBed(hospitalName) if not bedIndex then