Skip to content

Commit

Permalink
Converted export to client event in CEventNetworkEntityDamage handler
Browse files Browse the repository at this point in the history
  • Loading branch information
JHansen2000 committed Jul 24, 2024
1 parent 0d6f8d0 commit 8095703
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions client/dead.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ local config = require 'config.client'
local sharedConfig = require 'config.shared'
local WEAPONS = exports.qbx_core:GetWeapons()
local allowRespawn = true
local killerData = {
attacker = nil,
weapon = nil
}

local function playDeadAnimation()
local deadAnimDict = 'dead'
Expand Down Expand Up @@ -97,10 +93,6 @@ exports('DisableRespawn', function()
allowRespawn = false
end)

exports('GetKillerData', function()
return killerData
end)

---log the death of a player along with the attacker and the weapon used.
---@param victim number ped
---@param attacker number ped
Expand Down Expand Up @@ -133,13 +125,7 @@ AddEventHandler('gameEventTriggered', function(event, data)
DeathTime = config.deathTime
OnDeath()
end

if victim == PlayerPedId() then
killerData = {
attacker = attacker,
weapon = weapon
}
end
TriggerEvent('qbx_medical:client:attackerData', attacker, weapon)
end)

function DisableControls()
Expand Down

0 comments on commit 8095703

Please sign in to comment.