Skip to content

Commit

Permalink
Fixed error
Browse files Browse the repository at this point in the history
  • Loading branch information
AtiLion committed Jun 16, 2017
1 parent ba68526 commit 9053c0f
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions DiscordHook/DiscordHook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 9053c0f

Please sign in to comment.