Skip to content
This repository was archived by the owner on Feb 16, 2025. It is now read-only.

Commit f3b5e9f

Browse files
authored
1.0.3
1 parent 80c631a commit f3b5e9f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Kill_Sound.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class KillSoundConfig : BasePluginConfig
2727
public class KillSound : BasePlugin, IPluginConfig<KillSoundConfig>
2828
{
2929
public override string ModuleName => "Kill Sound";
30-
public override string ModuleVersion => "1.0.2";
30+
public override string ModuleVersion => "1.0.3";
3131
public override string ModuleAuthor => "Gold KingZ";
3232
public override string ModuleDescription => "Sound On , Kill , HeadShot , Body";
3333
public KillSoundConfig Config { get; set; } = new KillSoundConfig();
@@ -461,8 +461,9 @@ private HookResult OnPlayerSayTeam(CCSPlayerController? player, CommandInfo info
461461
private HookResult OnPlayerDeath(EventPlayerDeath @event, GameEventInfo _)
462462
{
463463
var attacker = @event.Attacker;
464-
var attackerteam = attacker.TeamNum;
465464
var victim = @event.Userid;
465+
if (attacker == null || victim == null || !attacker.IsValid || !victim.IsValid || attacker.IsBot || attacker.IsHLTV)return HookResult.Continue;
466+
var attackerteam = attacker.TeamNum;
466467
var victimteam = victim.TeamNum;
467468
var headshot = @event.Headshot;
468469
var playerid = attacker.SteamID;
@@ -524,8 +525,9 @@ private HookResult OnPlayerDeath(EventPlayerDeath @event, GameEventInfo _)
524525
private HookResult OnPlayerHurt(EventPlayerHurt @event, GameEventInfo _)
525526
{
526527
var attacker = @event.Attacker;
527-
var attackerteam = attacker.TeamNum;
528528
var victim = @event.Userid;
529+
if (attacker == null || victim == null || !attacker.IsValid || !victim.IsValid || attacker.IsBot || attacker.IsHLTV)return HookResult.Continue;
530+
var attackerteam = attacker.TeamNum;
529531
var victimteam = victim.TeamNum;
530532
var hitgroup = @event.Hitgroup;
531533
var playerid = attacker.SteamID;

0 commit comments

Comments
 (0)