From 9053c0fee2d2642380084cb54949006df49f3f71 Mon Sep 17 00:00:00 2001 From: AtiLion Date: Fri, 16 Jun 2017 22:41:58 +0200 Subject: [PATCH] Fixed error --- DiscordHook/DiscordHook.cs | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/DiscordHook/DiscordHook.cs b/DiscordHook/DiscordHook.cs index 1aa8355..2e1adf6 100644 --- a/DiscordHook/DiscordHook.cs +++ b/DiscordHook/DiscordHook.cs @@ -211,25 +211,29 @@ private void OnPlayerDeath(Player player, byte damage, Vector3 force, EDeathCaus UnturnedPlayer Killer = UnturnedPlayer.FromCSteamID(killer); string cause; - if (Killer.VanishMode) + try { - for (int i = 0; i < Instance.Configuration.Instance.Bots.Count; i++) - if (Instance.Configuration.Instance.Bots[i].SendPotentialAbuse) - Sender.SendSingle(Messages.Generate_AbuseKill(Translations.Instance["abuse_vanish"], UnturnedPlayer.FromCSteamID(killer).SteamPlayer(), player.channel.owner, Instance.Configuration.Instance.Bots[i]), Instance.Configuration.Instance.Bots[i]); - } - else if (Killer.GodMode) - { - for (int i = 0; i < Instance.Configuration.Instance.Bots.Count; i++) - if (Instance.Configuration.Instance.Bots[i].SendPotentialAbuse) - Sender.SendSingle(Messages.Generate_AbuseKill(Translations.Instance["abuse_godmode"], UnturnedPlayer.FromCSteamID(killer).SteamPlayer(), player.channel.owner, Instance.Configuration.Instance.Bots[i]), Instance.Configuration.Instance.Bots[i]); - } - else if (NoTP.ContainsKey(Killer.SteamPlayer())) - { - for (int i = 0; i < Instance.Configuration.Instance.Bots.Count; i++) - if (Instance.Configuration.Instance.Bots[i].SendPotentialAbuse) - Sender.SendSingle(Messages.Generate_AbuseKill(Translations.Instance["abuse_teleport"], UnturnedPlayer.FromCSteamID(killer).SteamPlayer(), player.channel.owner, Instance.Configuration.Instance.Bots[i]), Instance.Configuration.Instance.Bots[i]); - NoTP.Remove(Killer.SteamPlayer()); + if (Killer.VanishMode) + { + for (int i = 0; i < Instance.Configuration.Instance.Bots.Count; i++) + if (Instance.Configuration.Instance.Bots[i].SendPotentialAbuse) + Sender.SendSingle(Messages.Generate_AbuseKill(Translations.Instance["abuse_vanish"], UnturnedPlayer.FromCSteamID(killer).SteamPlayer(), player.channel.owner, Instance.Configuration.Instance.Bots[i]), Instance.Configuration.Instance.Bots[i]); + } + else if (Killer.GodMode) + { + for (int i = 0; i < Instance.Configuration.Instance.Bots.Count; i++) + if (Instance.Configuration.Instance.Bots[i].SendPotentialAbuse) + Sender.SendSingle(Messages.Generate_AbuseKill(Translations.Instance["abuse_godmode"], UnturnedPlayer.FromCSteamID(killer).SteamPlayer(), player.channel.owner, Instance.Configuration.Instance.Bots[i]), Instance.Configuration.Instance.Bots[i]); + } + else if (NoTP.ContainsKey(Killer.SteamPlayer())) + { + for (int i = 0; i < Instance.Configuration.Instance.Bots.Count; i++) + if (Instance.Configuration.Instance.Bots[i].SendPotentialAbuse) + Sender.SendSingle(Messages.Generate_AbuseKill(Translations.Instance["abuse_teleport"], UnturnedPlayer.FromCSteamID(killer).SteamPlayer(), player.channel.owner, Instance.Configuration.Instance.Bots[i]), Instance.Configuration.Instance.Bots[i]); + NoTP.Remove(Killer.SteamPlayer()); + } } + catch(Exception ex) { } switch (death) {