diff --git a/client/main.lua b/client/main.lua index 0b22a28..81ebd5d 100644 --- a/client/main.lua +++ b/client/main.lua @@ -641,20 +641,20 @@ RegisterNetEvent('hospital:client:RespawnAtHospital', function() if Config.RespawnAtNearestHospital and #Config.Locations["hospital"] > 0 then local closestHospital, lowestDist local playerPed = PlayerPedId() - + if playerPed > 0 and DoesEntityExist(playerPed) then local playerCoords = GetEntityCoords(playerPed) - + for i=1, #Config.Locations["hospital"] do local dist = #(Config.Locations["hospital"][i]["location"] - playerCoords) - + if closestHospital == nil or dist < lowestDist then closestHospital = i lowestDist = dist end end end - + if closestHospital ~= nil then hospitalIndex = closestHospital end @@ -692,6 +692,10 @@ RegisterNetEvent('hospital:client:adminHeal', function() TriggerServerEvent('hospital:server:resetHungerThirst') end) +RegisterNetEvent('hospital:client:SetArmor', function (amount) + TriggerServerEvent('hospital:server:SetArmor', amount) +end) + RegisterNetEvent('QBCore:Client:OnPlayerUnload', function() local ped = PlayerPedId() TriggerServerEvent('hospital:server:SetDeathStatus', false)