diff --git a/client/dead.lua b/client/dead.lua index caf93d3..d0c20aa 100644 --- a/client/dead.lua +++ b/client/dead.lua @@ -21,10 +21,10 @@ end exports('PlayDeadAnimation', playDeadAnimation) ---put player in death animation and make invincible -function OnDeath() +function OnDeath(attacker, weapon) SetDeathState(sharedConfig.deathState.DEAD) - TriggerEvent('qbx_medical:client:onPlayerDied') - TriggerServerEvent('qbx_medical:server:onPlayerDied') + TriggerEvent('qbx_medical:client:onPlayerDied', attacker, weapon) + TriggerServerEvent('qbx_medical:server:onPlayerDied', attacker, weapon) TriggerServerEvent('InteractSound_SV:PlayOnSource', 'demo', 0.1) WaitForPlayerToStopMoving() @@ -118,14 +118,13 @@ AddEventHandler('gameEventTriggered', function(event, data) if not IsEntityAPed(victim) or not victimDied or NetworkGetPlayerIndexFromPed(victim) ~= cache.playerId or not IsEntityDead(cache.ped) then return end if DeathState == sharedConfig.deathState.ALIVE then Wait(1000) - StartLastStand() + StartLastStand(attacker, weapon) elseif DeathState == sharedConfig.deathState.LAST_STAND then EndLastStand() logDeath(victim, attacker, weapon) DeathTime = config.deathTime - OnDeath() + OnDeath(attacker, weapon) end - TriggerEvent('qbx_medical:client:attackerData', attacker, weapon) end) function DisableControls() diff --git a/client/laststand.lua b/client/laststand.lua index b5f6fa0..cbde87b 100644 --- a/client/laststand.lua +++ b/client/laststand.lua @@ -60,7 +60,7 @@ local function countdownLastStand() end ---put player in last stand mode and notify EMS. -function StartLastStand() +function StartLastStand(attacker, weapon) TriggerEvent('ox_inventory:disarm', cache.playerId, true) WaitForPlayerToStopMoving() TriggerServerEvent('InteractSound_SV:PlayOnSource', 'demo', 0.1) @@ -68,8 +68,8 @@ function StartLastStand() ResurrectPlayer() SetEntityHealth(cache.ped, 150) SetDeathState(sharedConfig.deathState.LAST_STAND) - TriggerEvent('qbx_medical:client:onPlayerLaststand') - TriggerServerEvent('qbx_medical:server:onPlayerLaststand') + TriggerEvent('qbx_medical:client:onPlayerLaststand', attacker, weapon) + TriggerServerEvent('qbx_medical:server:onPlayerLaststand', attacker, weapon) CreateThread(function() while DeathState == sharedConfig.deathState.LAST_STAND do countdownLastStand()