From 235ebe75c1f4cd459d5b7267c158627973d6136f Mon Sep 17 00:00:00 2001 From: AlmTech Date: Sat, 7 Sep 2019 18:12:08 +0200 Subject: [PATCH] Improved and fixed bugs with damage system --- gamemode/core/server/sv_player_damage.lua | 6 +++++- gamemode/settings/sv_settings.lua | 10 +++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/gamemode/core/server/sv_player_damage.lua b/gamemode/core/server/sv_player_damage.lua index a31f554..9ac9a50 100644 --- a/gamemode/core/server/sv_player_damage.lua +++ b/gamemode/core/server/sv_player_damage.lua @@ -17,7 +17,7 @@ local damagescales = { function GM:ScalePlayerDamage( pl, hitgroup, dmginfo ) -- This is used for getting shot etc if( damagescales[hitgroup] ~= nil ) then dmginfo:ScaleDamage( damagescales[hitgroup] ) end - Quantum.Debug( tostring(pl) .. " got damaged (" .. tostring(hitgroup) .. " : " .. tostring( math.Round( dmginfo:GetDamage() ) ) .. " )" ) + Quantum.Debug( tostring(pl) .. " got damaged ( " .. tostring(hitgroup) .. " : " .. tostring( math.Round( dmginfo:GetDamage() ) ) .. " )" ) end function GM:GetFallDamage( pl, vel ) @@ -50,4 +50,8 @@ hook.Add( "EntityTakeDamage", "Quantum_PlayerDamage_SoundEffect", function( pl, end) end +end) + +hook.Add( "PlayerDeath", "Quantum_PlayerDamage_RemoveIdleSounds", function( pl ) + if( timer.Exists( "Quantum_PlayerHurtSounds_" .. tostring( pl ) ) ) then timer.Remove( "Quantum_PlayerHurtSounds_" .. tostring( pl ) ) end end) \ No newline at end of file diff --git a/gamemode/settings/sv_settings.lua b/gamemode/settings/sv_settings.lua index f684dcc..5a1d0c8 100644 --- a/gamemode/settings/sv_settings.lua +++ b/gamemode/settings/sv_settings.lua @@ -10,11 +10,11 @@ Quantum.Server.Settings.VoiceChatRange = 400 Quantum.Server.Settings.DamageScale = { -- The scale of the damage for each hitgroup - [HITGROUP_HEAD] = 4, - [HITGROUP_CHEST] = 2, - [HITGROUP_STOMACH] = 1.5, - [HITGROUP_LEFTARM] = 0.8, - [HITGROUP_RIGHTARM] = 0.8, + [HITGROUP_HEAD] = 10, + [HITGROUP_CHEST] = 4, + [HITGROUP_STOMACH] = 2, + [HITGROUP_LEFTARM] = 1, + [HITGROUP_RIGHTARM] = 1, [HITGROUP_LEFTLEG] = 1, [HITGROUP_RIGHTLEG] = 1 }