Skip to content

Commit

Permalink
Remove armor handling from player load and unload events
Browse files Browse the repository at this point in the history
  • Loading branch information
Cocodrulo committed Jan 12, 2025
1 parent c17edb1 commit 0d73fbb
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 13 deletions.
1 change: 0 additions & 1 deletion client/job.lua
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function()
QBCore.Functions.GetPlayerData(function(PlayerData)
PlayerJob = PlayerData.job
onDuty = PlayerData.job.onduty
SetPedArmour(PlayerPedId(), PlayerData.metadata['armor'])
if (not PlayerData.metadata['inlaststand'] and PlayerData.metadata['isdead']) then
deathTime = Config.ReviveInterval
OnDeath()
Expand Down
4 changes: 0 additions & 4 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,6 @@ RegisterNetEvent('QBCore:Client:OnPlayerUnload', function()
local ped = PlayerPedId()
TriggerServerEvent('hospital:server:SetDeathStatus', false)
TriggerServerEvent('hospital:server:SetLaststandStatus', false)
TriggerServerEvent('hospital:server:SetArmor', GetPedArmour(ped))
if bedOccupying then
TriggerServerEvent('hospital:server:LeaveBed', bedOccupying, hospitalLocation)
end
Expand Down Expand Up @@ -789,9 +788,6 @@ CreateThread(function()
if weapon then
if armorDamaged and (bodypart == 'SPINE' or bodypart == 'UPPER_BODY') or weapon == Config.WeaponClasses['NOTHING'] then
checkDamage = false -- Don't check damage if the it was a body shot and the weapon class isn't that strong
if armorDamaged then
TriggerServerEvent('hospital:server:SetArmor', GetPedArmour(ped))
end
end

if checkDamage then
Expand Down
8 changes: 0 additions & 8 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,6 @@ RegisterNetEvent('hospital:server:SetLaststandStatus', function(bool)
end
end)

RegisterNetEvent('hospital:server:SetArmor', function(amount)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
if Player then
Player.Functions.SetMetaData('armor', amount)
end
end)

RegisterNetEvent('hospital:server:TreatWounds', function(playerId)
local src = source
local Player = QBCore.Functions.GetPlayer(src)
Expand Down

0 comments on commit 0d73fbb

Please sign in to comment.