Ejemplo n.º 1
0
        private void UnturnedPlayerEvents_OnPlayerChatted(Rocket.Unturned.Player.UnturnedPlayer player, ref UnityEngine.Color color, string message, SDG.Unturned.EChatMode chatMode, ref bool cancel)
        {
            var result = GetChannel(player.CSteamID);

            if (result != null && chatMode == 0 && player.HasPermission("channel." + result.Channel.ToLower()) && result.Channel.ToLower() != "global" && !message.StartsWith("/") && !message.StartsWith("@"))
            {
                cancel = true;
                foreach (var steamplayer in Provider.clients)
                {
                    UnturnedPlayer stm = UnturnedPlayer.FromSteamPlayer(steamplayer);
                    if (stm.HasPermission("channel." + result.Channel.ToLower()))
                    {
                        UnturnedChat.Say(steamplayer.playerID.steamID, "[" + result.Channel + "] " + player.CharacterName + " : " + message);
                        Times = 1;
                    }
                }
            }
            if (result.Channel.ToLower() == "global" && chatMode == 0 && (!message.StartsWith("/") && !message.StartsWith("@")))
            {
                if (player.HasPermission("chat.global"))
                {
                    ChatManager.instance.askChat(player.CSteamID, 0, message);
                    Times = 1;
                }
            }
            if (Times == 0)
            {
                UnturnedChat.Say(player, Translate("no_permission"));
            }
        }
Ejemplo n.º 2
0
        private void UnturnedPlayerEvents_OnPlayerDeath(Rocket.Unturned.Player.UnturnedPlayer player, SDG.Unturned.EDeathCause cause, SDG.Unturned.ELimb limb, Steamworks.CSteamID murderer)
        {
            UnturnedPlayer killer      = UnturnedPlayer.FromCSteamID(murderer);
            string         currentPath = System.IO.Directory.GetCurrentDirectory();
            string         playerSID   = player.CSteamID + ".txt";
            string         murdererSID = Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer) + "";
            string         player1SID  = player.CSteamID + "";
            string         player2SID  = killer.CSteamID + "";
            string         player1Name = player.CharacterName + "";
            string         player2Name = killer.CharacterName + "";
            string         player1File = player.CSteamID + ".txt";
            string         player2File = killer.CSteamID + ".txt";
            string         player3File = player.CharacterName + ".txt";
            string         player4File = killer.CharacterName + ".txt";
            string         fileName1   = currentPath + "\\Plugins\\CFire\\Players\\" + player1File;
            string         fileName2   = currentPath + "\\Plugins\\CFire\\Players\\" + player2File;
            string         fileName3   = currentPath + "\\Plugins\\CFire\\Players\\Characters\\" + player3File;
            string         fileName4   = currentPath + "\\Plugins\\CFire\\Players\\Characters\\" + player4File;
            string         line;

            System.IO.StreamReader file =
                new System.IO.StreamReader(currentPath + "\\Plugins\\CFire\\Players\\" + playerSID);
            while ((line = file.ReadLine()) != null)
            {
                if (line == murdererSID)
                {
                    file.Close();
                    Execute(player, killer);

                    deathPos = lastPos;
                    tpDeaths.Add(player.CSteamID, deathPos);

                    //remove ceasefire from first player SID
                    List <string> cfList1 = File.ReadAllLines(fileName1).ToList();
                    cfList1.Remove(player2SID);
                    File.WriteAllLines(fileName1, cfList1.ToArray());
                    //remove ceasefire from second player SID
                    List <string> cfList2 = File.ReadAllLines(fileName2).ToList();
                    cfList2.Remove(player1SID);
                    File.WriteAllLines(fileName2, cfList2.ToArray());
                    //remove ceasefire from first player Name
                    List <string> cfList3 = File.ReadAllLines(fileName3).ToList();
                    cfList3.Remove(player2Name);
                    File.WriteAllLines(fileName3, cfList3.ToArray());
                    //remove ceasefire from second player Name
                    List <string> cfList4 = File.ReadAllLines(fileName4).ToList();
                    cfList4.Remove(player1Name);
                    File.WriteAllLines(fileName4, cfList4.ToArray());

                    Rocket.Unturned.Chat.UnturnedChat.Say(player, killer.CharacterName + " " + CFire_Plugin.Instance.Translate("cf_kill"), Color.red);
                    Rocket.Unturned.Chat.UnturnedChat.Say(killer, CFire_Plugin.Instance.Translate("cf_kill_1") + " " + player.CharacterName, Color.red);
                    break;
                }
            }
            file.Close();
        }
Ejemplo n.º 3
0
 void Events_OnPlayerConnected(Rocket.Unturned.Player.UnturnedPlayer player)
 {
     if (Configuration.Instance.OpenUrlOnJoin)
     {
         new Thread(() =>
         {
             Thread.Sleep(1500);
             OpenUrl(player, Configuration.Instance.JoinUrl, Configuration.Instance.JoinDesc);
         }).Start();
     }
 }
        private void OnPlayerChatted(Rocket.Unturned.Player.UnturnedPlayer player, ref UnityEngine.Color color, string message, SDG.Unturned.EChatMode chatMode, ref bool cancel)
        {
            PlayerComponent component = player.GetComponent <PlayerComponent>();

            if (component.isMuted)
            {
                cancel = true;
                UnturnedChat.Say(player, "Sorry, you are muted.", Color.red);
                return;
            }
        }
Ejemplo n.º 5
0
        private void UnturnedPlayerEvents_OnPlayerDeath(Rocket.Unturned.Player.UnturnedPlayer player, SDG.Unturned.EDeathCause cause, SDG.Unturned.ELimb limb, Steamworks.CSteamID murderer)
        {
            UnturnedPlayer killer         = Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer);
            string         currentPath    = System.IO.Directory.GetCurrentDirectory();
            string         filePath       = currentPath + "\\Plugins\\StatKeeper\\Stats\\";
            string         playerStatFile = filePath + player.CSteamID + ".xml";
            string         killerStatFile = filePath + killer.CSteamID + ".xml";

            XmlDocument playerDoc = new XmlDocument();

            playerDoc.Load(playerStatFile);
            XmlElement  playerPvPRoot  = playerDoc.DocumentElement;
            XmlNodeList playerPvPNodes = playerPvPRoot.SelectNodes("/Stats/PvP");
            XmlElement  playerPvERoot  = playerDoc.DocumentElement;
            XmlNodeList playerPvENodes = playerPvERoot.SelectNodes("/Stats/PvE");

            XmlDocument killerDoc = new XmlDocument();

            killerDoc.Load(killerStatFile);
            XmlElement  killerPvPRoot  = killerDoc.DocumentElement;
            XmlNodeList killerPvPNodes = killerPvPRoot.SelectNodes("/Stats/PvP");
            XmlElement  killerPvERoot  = killerDoc.DocumentElement;
            XmlNodeList killerPvENodes = playerPvERoot.SelectNodes("/Stats/PvE");

            if (cause.ToString() == "ZOMBIE")
            {
                foreach (XmlNode node in playerPvENodes)
                {
                    int tDeaths    = int.Parse(node["TotalDeaths"].InnerText);
                    int zDeaths    = int.Parse(node["ZombieDeaths"].InnerText);
                    int newtDeaths = tDeaths + 1;
                    int newzDeaths = zDeaths + 1;

                    XmlNode totDeaths = playerPvERoot.SelectSingleNode("TotalDeaths");
                    totDeaths.Value = newtDeaths + "";
                    XmlNode zomDeaths = playerPvERoot.SelectSingleNode("ZombieDeaths");
                    zomDeaths.Value = newzDeaths + "";

                    playerDoc.Save(playerStatFile);
                }
            }
            else if (cause.ToString() == "GUN")
            {
                foreach (XmlNode node in playerPvPNodes)
                {
                    int   tDeaths    = int.Parse(node["TotalDeaths"].InnerText);
                    int   gDeaths    = int.Parse(node["GunDeaths"].InnerText);
                    int   tKills     = int.Parse(node["TotalKills"].InnerText);
                    int   kdRatio    = int.Parse(node["KDRatio"].InnerText);
                    int   newtDeaths = tDeaths + 1;
                    int   newgDeaths = gDeaths + 1;
                    float newKDRatio;
                    if (tKills > 0 && tDeaths == 0)
                    {
                        newKDRatio = tKills / 1;
                    }
                    else
                    {
                        newKDRatio = tKills / newtDeaths;
                    }

                    node["TotalDeaths"].InnerText = newtDeaths + "";
                    node["GunDeaths"].InnerText   = newgDeaths + "";
                    node["KDRatio"].InnerText     = newKDRatio + "";

                    playerDoc.Save(playerStatFile);
                }
                foreach (XmlNode node in killerPvPNodes)
                {
                    int   tDeaths   = int.Parse(node["TotalDeaths"].InnerText);
                    int   gKills    = int.Parse(node["GunKills"].InnerText);
                    int   tKills    = int.Parse(node["TotalKills"].InnerText);
                    int   kdRatio   = int.Parse(node["KDRatio"].InnerText);
                    int   newtKills = tKills + 1;
                    int   newgKills = gKills + 1;
                    float newKDRatio;
                    if (newtKills > 0 && tDeaths == 0)
                    {
                        newKDRatio = newtKills / 1;
                    }
                    else
                    {
                        newKDRatio = newtKills / tDeaths;
                    }

                    node["TotalKills"].InnerText = newtKills + "";
                    node["GunKills"].InnerText   = newgKills + "";
                    node["KDRatio"].InnerText    = newKDRatio + "";

                    playerDoc.Save(killerStatFile);
                }
            }
            else if (cause.ToString() == "MELEE")
            {
                foreach (XmlNode node in playerPvPNodes)
                {
                    int   tDeaths    = int.Parse(node["TotalDeaths"].InnerText);
                    int   mDeaths    = int.Parse(node["MeleeDeaths"].InnerText);
                    int   tKills     = int.Parse(node["TotalKills"].InnerText);
                    int   kdRatio    = int.Parse(node["KDRatio"].InnerText);
                    int   newtDeaths = tDeaths + 1;
                    int   newmDeaths = mDeaths + 1;
                    float newKDRatio;
                    if (tKills > 0 && tDeaths == 0)
                    {
                        newKDRatio = tKills / 1;
                    }
                    else
                    {
                        newKDRatio = tKills / newtDeaths;
                    }

                    node["TotalDeaths"].InnerText = newtDeaths + "";
                    node["MeleeDeaths"].InnerText = newmDeaths + "";
                    node["KDRatio"].InnerText     = newKDRatio + "";

                    playerDoc.Save(playerStatFile);
                }
                foreach (XmlNode node in killerPvPNodes)
                {
                    int   tDeaths   = int.Parse(node["TotalDeaths"].InnerText);
                    int   mKills    = int.Parse(node["MeleeKills"].InnerText);
                    int   tKills    = int.Parse(node["TotalKills"].InnerText);
                    int   kdRatio   = int.Parse(node["KDRatio"].InnerText);
                    int   newtKills = tKills + 1;
                    int   newmKills = mKills + 1;
                    float newKDRatio;
                    if (newtKills > 0 && tDeaths == 0)
                    {
                        newKDRatio = newtKills / 1;
                    }
                    else
                    {
                        newKDRatio = newtKills / tDeaths;
                    }

                    node["TotalKills"].InnerText = newtKills + "";
                    node["MeleeKills"].InnerText = newmKills + "";
                    node["KDRatio"].InnerText    = newKDRatio + "";

                    playerDoc.Save(killerStatFile);
                }
            }
            else if (cause.ToString() == "PUNCH")
            {
                foreach (XmlNode node in playerPvPNodes)
                {
                    int   tDeaths    = int.Parse(node["TotalDeaths"].InnerText);
                    int   pDeaths    = int.Parse(node["PunchDeaths"].InnerText);
                    int   tKills     = int.Parse(node["TotalKills"].InnerText);
                    int   kdRatio    = int.Parse(node["KDRatio"].InnerText);
                    int   newtDeaths = tDeaths + 1;
                    int   newpDeaths = pDeaths + 1;
                    float newKDRatio;
                    if (tKills > 0 && tDeaths == 0)
                    {
                        newKDRatio = tKills / 1;
                    }
                    else
                    {
                        newKDRatio = tKills / newtDeaths;
                    }

                    node["TotalDeaths"].InnerText = newtDeaths + "";
                    node["PunchDeaths"].InnerText = newpDeaths + "";
                    node["KDRatio"].InnerText     = newKDRatio + "";

                    playerDoc.Save(playerStatFile);
                }
                foreach (XmlNode node in killerPvPNodes)
                {
                    int   tDeaths   = int.Parse(node["TotalDeaths"].InnerText);
                    int   pKills    = int.Parse(node["PunchKills"].InnerText);
                    int   tKills    = int.Parse(node["TotalKills"].InnerText);
                    int   kdRatio   = int.Parse(node["KDRatio"].InnerText);
                    int   newtKills = tKills + 1;
                    int   newpKills = pKills + 1;
                    float newKDRatio;
                    if (newtKills > 0 && tDeaths == 0)
                    {
                        newKDRatio = newtKills / 1;
                    }
                    else
                    {
                        newKDRatio = newtKills / tDeaths;
                    }

                    node["TotalKills"].InnerText = newtKills + "";
                    node["PunchKills"].InnerText = newpKills + "";
                    node["KDRatio"].InnerText    = newKDRatio + "";

                    playerDoc.Save(killerStatFile);
                }
            }
            else if (cause.ToString() == "ROADKILL")
            {
                foreach (XmlNode node in playerPvPNodes)
                {
                    int   tDeaths    = int.Parse(node["TotalDeaths"].InnerText);
                    int   rDeaths    = int.Parse(node["RoadDeaths"].InnerText);
                    int   tKills     = int.Parse(node["TotalKills"].InnerText);
                    int   kdRatio    = int.Parse(node["KDRatio"].InnerText);
                    int   newtDeaths = tDeaths + 1;
                    int   newrDeaths = rDeaths + 1;
                    float newKDRatio;
                    if (tKills > 0 && tDeaths == 0)
                    {
                        newKDRatio = tKills / 1;
                    }
                    else
                    {
                        newKDRatio = tKills / newtDeaths;
                    }

                    node["TotalDeaths"].InnerText = newtDeaths + "";
                    node["RoadDeaths"].InnerText  = newrDeaths + "";
                    node["KDRatio"].InnerText     = newKDRatio + "";

                    playerDoc.Save(playerStatFile);
                }
                foreach (XmlNode node in killerPvPNodes)
                {
                    int   tDeaths   = int.Parse(node["TotalDeaths"].InnerText);
                    int   rKills    = int.Parse(node["RoadKills"].InnerText);
                    int   tKills    = int.Parse(node["TotalKills"].InnerText);
                    int   kdRatio   = int.Parse(node["KDRatio"].InnerText);
                    int   newtKills = tKills + 1;
                    int   newrKills = rKills + 1;
                    float newKDRatio;
                    if (newtKills > 0 && tDeaths == 0)
                    {
                        newKDRatio = newtKills / 1;
                    }
                    else
                    {
                        newKDRatio = newtKills / tDeaths;
                    }

                    node["TotalKills"].InnerText = newtKills + "";
                    node["RoadKills"].InnerText  = newrKills + "";
                    node["KDRatio"].InnerText    = newKDRatio + "";

                    playerDoc.Save(killerStatFile);
                }
            }
            else if (cause.ToString() == "VEHICLE")
            {
                foreach (XmlNode node in playerPvENodes)
                {
                    int tDeaths    = int.Parse(node["TotalDeaths"].InnerText);
                    int vDeaths    = int.Parse(node["VehicleDeaths"].InnerText);
                    int newtDeaths = tDeaths + 1;
                    int newvDeaths = vDeaths + 1;

                    node["TotalDeaths"].InnerText   = newtDeaths + "";
                    node["VehicleDeaths"].InnerText = newvDeaths + "";

                    playerDoc.Save(playerStatFile);
                }
            }
            else if (cause.ToString() == "FOOD")
            {
                foreach (XmlNode node in playerPvENodes)
                {
                    int tDeaths    = int.Parse(node["TotalDeaths"].InnerText);
                    int fDeaths    = int.Parse(node["FoodDeaths"].InnerText);
                    int newtDeaths = tDeaths + 1;
                    int newfDeaths = fDeaths + 1;

                    node["TotalDeaths"].InnerText = newtDeaths + "";
                    node["FoodDeaths"].InnerText  = newfDeaths + "";

                    playerDoc.Save(playerStatFile);
                }
            }
            else if (cause.ToString() == "WATER")
            {
                foreach (XmlNode node in playerPvENodes)
                {
                    int tDeaths    = int.Parse(node["TotalDeaths"].InnerText);
                    int wDeaths    = int.Parse(node["FoodDeaths"].InnerText);
                    int newtDeaths = tDeaths + 1;
                    int newwDeaths = wDeaths + 1;

                    node["TotalDeaths"].InnerText = newtDeaths + "";
                    node["WaterDeaths"].InnerText = newwDeaths + "";

                    playerDoc.Save(playerStatFile);
                }
            }
            else if (cause.ToString() == "INFECTION")
            {
                foreach (XmlNode node in playerPvENodes)
                {
                    int tDeaths    = int.Parse(node["TotalDeaths"].InnerText);
                    int iDeaths    = int.Parse(node["InfectionDeaths"].InnerText);
                    int newtDeaths = tDeaths + 1;
                    int newiDeaths = iDeaths + 1;

                    node["TotalDeaths"].InnerText     = newtDeaths + "";
                    node["InfectionDeaths"].InnerText = newiDeaths + "";

                    playerDoc.Save(playerStatFile);
                }
            }
            else if (cause.ToString() == "BLEEDING")
            {
                foreach (XmlNode node in playerPvENodes)
                {
                    int tDeaths    = int.Parse(node["TotalDeaths"].InnerText);
                    int bDeaths    = int.Parse(node["BleedingDeaths"].InnerText);
                    int newtDeaths = tDeaths + 1;
                    int newbDeaths = bDeaths + 1;

                    node["TotalDeaths"].InnerText    = newtDeaths + "";
                    node["BleedingDeaths"].InnerText = newbDeaths + "";

                    playerDoc.Save(playerStatFile);
                }
            }
            else if (cause.ToString() == "SUICIDE")
            {
                foreach (XmlNode node in playerPvPNodes)
                {
                    int   tDeaths    = int.Parse(node["TotalDeaths"].InnerText);
                    int   sDeaths    = int.Parse(node["SuicideDeaths"].InnerText);
                    int   tKills     = int.Parse(node["TotalKills"].InnerText);
                    int   kdRatio    = int.Parse(node["KDRatio"].InnerText);
                    int   newtDeaths = tDeaths + 1;
                    int   newsDeaths = sDeaths + 1;
                    float newKDRatio = tKills / newtDeaths;

                    node["TotalDeaths"].InnerText   = newtDeaths + "";
                    node["SuicideDeaths"].InnerText = newsDeaths + "";
                    node["KDRatio"].InnerText       = newKDRatio + "";

                    playerDoc.Save(playerStatFile);
                }
            }
        }
Ejemplo n.º 6
0
        void UnturnedPlayerEvents_OnPlayerChatted(Rocket.Unturned.Player.UnturnedPlayer player, ref UnityEngine.Color color, string message, EChatMode chatMode, ref bool cancel)
        {
            if (matchesSpamPoint)
            {
                matchesSpamPoint = false;
            }
            if (!lastMessages.ContainsKey(player.CSteamID))
            {
                lastMessages.Add(player.CSteamID, message);
            }
            if (!sameMessageCount.ContainsKey(player.CSteamID))
            {
                sameMessageCount.Add(player.CSteamID, 0);
            }
            if (message == lastMessages[player.CSteamID])
            {
                IRocketPlayer rPlayer;
                if (!((IRocketPlayer)player).HasPermission("bypassspamwarning"))
                {
                    sameMessageCount[player.CSteamID]++;
                }

                //Logger.LogError("Spam found. Count: " + sameMessageCount[player.CSteamID]);

                if (Instance.Configuration.Instance.SpamWarningPoints.Contains(sameMessageCount[player.CSteamID]))
                {
                    matchesSpamPoint = true;
                }

                if (matchesSpamPoint)
                {
                    foreach (SteamPlayer p in Provider.clients)
                    {
                        rPlayer = (IRocketPlayer)UnturnedPlayer.FromSteamPlayer(p);
                        if (rPlayer.HasPermission("spamwarning"))
                        {
                            UnturnedChat.Say(rPlayer, "SPAM WARNING: [" + player.DisplayName + "] has spammed \"" + message + "\" " +
                                             sameMessageCount[player.CSteamID] + " times!", UnityEngine.Color.red);
                        }
                    }

                    Logger.LogWarning("SPAM WARNING: [" + player.DisplayName + "] has spammed \"" + message + "\" " +
                                      sameMessageCount[player.CSteamID] + " times!");
                }
            }
            else
            {
                sameMessageCount[player.CSteamID] = 0;
                lastMessages[player.CSteamID]     = message;
            }

            if (chatLogPlayers.Count == 0 || Instance.Configuration.Instance.SteamIdsToNotLogChat.Contains(player.Id))
            {
                return;
            }

            if (message.Contains("/"))
            {
                if (message.IndexOf("/") == 0)
                {
                    for (int ii = chatLogPlayers.Count - 1; ii >= 0; ii--)
                    {
                        if (player.CSteamID == chatLogPlayers[ii])
                        {
                            continue;
                        }

                        if (chatLogPlayers[ii] == null)
                        {
                            chatLogPlayers.Remove(chatLogPlayers[ii]);
                            continue;
                        }
                        else
                        {
                            UnturnedChat.Say(UnturnedPlayer.FromCSteamID(chatLogPlayers[ii]), "[" + player.DisplayName + "] " + message, UnityEngine.Color.blue);
                        }
                    }
                }
            }
        }
Ejemplo n.º 7
0
        private void UnturnedPlayerEvents_OnPlayerDeath(Rocket.Unturned.Player.UnturnedPlayer player, EDeathCause cause, ELimb limb, CSteamID murderer)
        {
            try
            {
                murderer3 = UnturnedPlayer.FromCSteamID(murderer);
                int num = Provider.clients.Count;
                if (Instance.Configuration.Instance.Groups != null && Instance.Configuration.Instance.Groups.Count > 0)
                {
                    foreach (SteamPlayer current in Provider.clients)
                    {
                        if (CheckDeathMessage(current.playerID.steamID))
                        {
                            num--;
                        }
                    }
                }


                if (cause.ToString() == "ZOMBIE")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.zombie + " ", UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
                else if (cause.ToString() == "GUN")
                {
                    if (limb == ELimb.SKULL)
                    {
                        UnturnedChat.Say(player.CharacterName + ", " + Configuration.Instance.headshotgun + ", " + Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.usinga + " " + Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString() + " " + "!", UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    }
                    else if (limb == ELimb.SPINE)
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.gun + ", " + player.CharacterName + ", " + Configuration.Instance.usinga + " " + UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString() + " " + "!", UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    }
                    else if (limb == ELimb.RIGHT_ARM || limb == ELimb.LEFT_ARM)
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.gun + ", " + player.CharacterName + ", " + Configuration.Instance.usinga + " " + UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString() + " " + "!", UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    }
                    else if (limb == ELimb.RIGHT_LEG || limb == ELimb.LEFT_LEG)
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.gun + ", " + player.CharacterName + ", " + Configuration.Instance.usinga + " " + UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString() + " " + "!", UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    }
                    else
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.gun + ", " + player.CharacterName + ", " + Configuration.Instance.usinga + " " + Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString() + " " + "!", UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    }
                }
                else if (cause.ToString() == "MELEE")
                {
                    if (limb == ELimb.SKULL)
                    {
                        UnturnedChat.Say(player.CharacterName + ", " + Configuration.Instance.headchop + ", " + UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.usinga + " " + Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString() + " " + "!", UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    }
                    else if (limb == ELimb.SPINE)
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.melee + ", " + player.CharacterName + ", " + Configuration.Instance.melee2 + " " + Configuration.Instance.usinga + " " + Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString(), UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    }
                    else if (limb == ELimb.RIGHT_ARM || limb == ELimb.LEFT_ARM)
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.melee + ", " + player.CharacterName + ", " + Configuration.Instance.melee2 + " " + Configuration.Instance.usinga + " " + Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString(), UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    }
                    else if (limb == ELimb.RIGHT_LEG || limb == ELimb.LEFT_LEG)
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.melee + ", " + player.CharacterName + ", " + Configuration.Instance.melee2 + " " + Configuration.Instance.usinga + " " + Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString(), UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    }
                    else
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.melee + ", " + player.CharacterName + ", " + Configuration.Instance.melee2 + " " + Configuration.Instance.usinga + " " + Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString(), UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    }
                }
                else if (cause.ToString() == "PUNCH")
                {
                    if (limb == ELimb.SKULL)
                    {
                        UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.headpunch + ", " + Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + "!", UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    }
                    else if (limb == ELimb.SPINE)
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.punch + " " + player.CharacterName + ", " + Configuration.Instance.punch2, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    }
                    else if (limb == ELimb.RIGHT_ARM || limb == ELimb.LEFT_ARM)
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.punch + " " + player.CharacterName + ", " + Configuration.Instance.punch2, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    }
                    else if (limb == ELimb.RIGHT_LEG || limb == ELimb.LEFT_LEG)
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.punch + " " + player.CharacterName + ", " + Configuration.Instance.punch2, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    }
                    else
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.punch + " " + player.CharacterName + ", " + Configuration.Instance.punch2, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    }
                }
                else if (cause.ToString() == "SHRED")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.shred, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
                else if (cause.ToString() == "ROADKILL")
                {
                    UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.roadkill + " " + player.CharacterName + ", " + Configuration.Instance.usinga + " " + Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).CurrentVehicle.asset.vehicleName.ToString() + "!", UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
                else if (cause.ToString() == "SPARK")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.spark, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
                else if (cause.ToString() == "VEHICLE")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.vehicle, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
                else if (cause.ToString() == "FOOD")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.food, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
                else if (cause.ToString() == "WATER")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.water, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
                else if (cause.ToString() == "INFECTION")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.infection, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
                else if (cause.ToString() == "BLEEDING")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.bleeding, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
                else if (cause.ToString() == "LANDMINE")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.landmine, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
                else if (cause.ToString() == "BREATH")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.breath, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
                else if (cause.ToString() == "GRENADE")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.grenade, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
                else if (cause.ToString() == "FREEZING")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.freezing, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
                else if (cause.ToString() == "SENTRY")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.sentry, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
                else if (cause.ToString() == "CHARGE")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.charge, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
                else if (cause.ToString() == "MISSILE")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.missile, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
                else if (cause.ToString() == "BONES")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.bones, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
                else if (cause.ToString() == "SPLASH")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.splash, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
                else if (cause.ToString() == "ACID")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.acid, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
                else if (cause.ToString() == "SPIT")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.spit, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
                else if (cause.ToString() == "BURNING")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.fire, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
                else if (cause.ToString() == "BURNER")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.fire, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
                else if (cause.ToString() == "BOULDER")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.boulder, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }

                else if (cause.ToString() == "SUICIDE" && Configuration.Instance.suicidemsg)
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.suicide, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
            }
            catch
            {
                Rocket.Core.Logging.Logger.LogError(
                    string.Format("Error trying to display message for cause: {0}", cause.ToString())
                    );
            }
        }
        private void UnturnedPlayerEvents_OnPlayerDeath(Rocket.Unturned.Player.UnturnedPlayer player, EDeathCause cause, ELimb limb, CSteamID murderer)


        {
            murderer3 = UnturnedPlayer.FromCSteamID(murderer);
            string Part = "???";
            int    num  = Provider.clients.Count;

            if (Instance.Configuration.Instance.Groups != null && Instance.Configuration.Instance.Groups.Count > 0)
            {
                foreach (SteamPlayer current in Provider.clients)
                {
                    if (CheckDeathMessage(current.playerID.steamID))
                    {
                        num--;
                    }
                }
            }


            {
                if (cause.ToString() == "ZOMBIE")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.zombie + " ", UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                }
                else if (cause.ToString() == "GUN")
                {
                    if (limb == ELimb.SKULL)
                    {
                        UnturnedChat.Say(player.CharacterName + ", " + Configuration.Instance.headshotgun + ", " + Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.usinga + " " + Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString() + " " + "!", UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                        if (Configuration.Instance.UconomyEnabled)
                        {
                            UnturnedChat.Say(murderer, "You recieved" + " " + Configuration.Instance.Head + " " + Uconomy.Instance.Configuration.Instance.MoneyName + " " + "for getting a Headshot!", Color.green);
                        }
                    }
                    else if (limb == ELimb.SPINE)
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.gun + ", " + player.CharacterName + ", " + Configuration.Instance.usinga + " " + UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString() + " " + "!", UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                        if (Configuration.Instance.UconomyEnabled)
                        {
                            UnturnedChat.Say(murderer, "You recieved" + " " + Configuration.Instance.Body + " " + Uconomy.Instance.Configuration.Instance.MoneyName + " " + "for getting a body shot!", Color.green);
                        }
                    }
                    else if (limb == ELimb.RIGHT_ARM || limb == ELimb.LEFT_ARM || limb == ELimb.LEFT_HAND || limb == ELimb.RIGHT_HAND)
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.gun + ", " + player.CharacterName + ", " + Configuration.Instance.usinga + " " + UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString() + " " + "!", UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                        if (Configuration.Instance.UconomyEnabled)
                        {
                            UnturnedChat.Say(murderer, "You recieved" + " " + Configuration.Instance.Arm + " " + Uconomy.Instance.Configuration.Instance.MoneyName + " " + "for getting an arm shot!", Color.green);
                        }
                    }
                    else if (limb == ELimb.RIGHT_LEG || limb == ELimb.LEFT_LEG || limb == ELimb.LEFT_FOOT || limb == ELimb.RIGHT_FOOT)
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.gun + ", " + player.CharacterName + ", " + Configuration.Instance.usinga + " " + UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString() + " " + "!", UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                        if (Configuration.Instance.UconomyEnabled)
                        {
                            UnturnedChat.Say(murderer, "You recieved" + " " + Configuration.Instance.Leg + " " + Uconomy.Instance.Configuration.Instance.MoneyName + " " + "for getting a leg shot!", Color.green);
                        }
                    }
                    else
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.gun + ", " + player.CharacterName + ", " + Configuration.Instance.usinga + " " + Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString() + " " + "!", UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    }
                }
                else if (cause.ToString() == "MELEE")
                {
                    if (limb == ELimb.SKULL)
                    {
                        UnturnedChat.Say(player.CharacterName + ", " + Configuration.Instance.headchop + ", " + UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.usinga + " " + Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString() + " " + "!", UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                        if (Configuration.Instance.UconomyEnabled)
                        {
                            UnturnedChat.Say(murderer, "You recieved" + " " + Configuration.Instance.Head + " " + Uconomy.Instance.Configuration.Instance.MoneyName + " " + "for getting a head chop!", Color.yellow);
                        }
                    }
                    else if (limb == ELimb.SPINE)
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.melee + ", " + player.CharacterName + ", " + Configuration.Instance.melee2 + " " + Configuration.Instance.usinga + " " + Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString(), UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                        if (Configuration.Instance.UconomyEnabled)
                        {
                            UnturnedChat.Say(murderer, "You recieved" + " " + Configuration.Instance.Body + " " + Uconomy.Instance.Configuration.Instance.MoneyName + " " + "for getting a body kill!", Color.green);
                        }
                    }
                    else if (limb == ELimb.RIGHT_ARM || limb == ELimb.LEFT_ARM || limb == ELimb.LEFT_HAND || limb == ELimb.RIGHT_HAND)
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.melee + ", " + player.CharacterName + ", " + Configuration.Instance.melee2 + " " + Configuration.Instance.usinga + " " + Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString(), UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                        if (Configuration.Instance.UconomyEnabled)
                        {
                            UnturnedChat.Say(murderer, "You recieved" + " " + Configuration.Instance.Arm + " " + Uconomy.Instance.Configuration.Instance.MoneyName + " " + "for getting an arm kill!", Color.green);
                        }
                    }
                    else if (limb == ELimb.RIGHT_LEG || limb == ELimb.LEFT_LEG || limb == ELimb.LEFT_FOOT || limb == ELimb.RIGHT_FOOT)
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.melee + ", " + player.CharacterName + ", " + Configuration.Instance.melee2 + " " + Configuration.Instance.usinga + " " + Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString(), UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                        if (Configuration.Instance.UconomyEnabled)
                        {
                            UnturnedChat.Say(murderer, "You recieved" + " " + Configuration.Instance.Leg + " " + Uconomy.Instance.Configuration.Instance.MoneyName + " " + "for getting a leg kill!", Color.green);
                        }
                    }
                    else
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.melee + ", " + player.CharacterName + ", " + Configuration.Instance.melee2 + " " + Configuration.Instance.usinga + " " + Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString(), UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    }
                }
                else if (cause.ToString() == "PUNCH")
                {
                    if (limb == ELimb.SKULL)
                    {
                        UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.headpunch + ", " + Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + "!", UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                        if (Configuration.Instance.UconomyEnabled)
                        {
                            UnturnedChat.Say(murderer, "You recieved" + " " + Configuration.Instance.Head + " " + Uconomy.Instance.Configuration.Instance.MoneyName + " " + "for getting a head punch kill!", Color.green);
                        }
                    }
                    else if (limb == ELimb.SPINE)
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.punch + " " + player.CharacterName + ", " + Configuration.Instance.punch2, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                        if (Configuration.Instance.UconomyEnabled)
                        {
                            UnturnedChat.Say(murderer, "You recieved" + " " + Configuration.Instance.Body + " " + Uconomy.Instance.Configuration.Instance.MoneyName + " " + "for getting a body punch kill!", Color.green);
                        }
                    }
                    else if (limb == ELimb.RIGHT_ARM || limb == ELimb.LEFT_ARM || limb == ELimb.LEFT_HAND || limb == ELimb.RIGHT_HAND)
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.punch + " " + player.CharacterName + ", " + Configuration.Instance.punch2, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                        if (Configuration.Instance.UconomyEnabled)
                        {
                            UnturnedChat.Say(murderer, "You recieved" + " " + Configuration.Instance.Arm + " " + Uconomy.Instance.Configuration.Instance.MoneyName + " " + "for getting an arm punch kill!", Color.green);
                        }
                    }
                    else if (limb == ELimb.RIGHT_LEG || limb == ELimb.LEFT_LEG || limb == ELimb.LEFT_FOOT || limb == ELimb.RIGHT_FOOT)
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.punch + " " + player.CharacterName + ", " + Configuration.Instance.punch2, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                        if (Configuration.Instance.UconomyEnabled)
                        {
                            UnturnedChat.Say(murderer, "You recieved" + " " + Configuration.Instance.Leg + " " + Uconomy.Instance.Configuration.Instance.MoneyName + " " + "for getting a leg punch kill!", Color.green);
                        }
                    }
                    else
                    {
                        UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.punch + " " + player.CharacterName + ", " + Configuration.Instance.punch2, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    }
                }
                else if (cause.ToString() == "SHRED")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.shred, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    if (Configuration.Instance.UconomyEnabled)
                    {
                        // Do nothing
                    }
                }
                else if (cause.ToString() == "ROADKILL")
                {
                    UnturnedChat.Say(UnturnedPlayer.FromCSteamID(murderer).CharacterName + ", " + "HP:" + " " + UnturnedPlayer.FromCSteamID(murderer).Health.ToString() + "%" + ", " + Configuration.Instance.roadkill + " " + player.CharacterName + ", " + Configuration.Instance.usinga + " " + Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).CurrentVehicle.asset.vehicleName.ToString() + "!", UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    if (Configuration.Instance.UconomyEnabled)
                    {
                        UnturnedChat.Say(murderer, "You recieved" + " " + Configuration.Instance.Roadkill + " " + Uconomy.Instance.Configuration.Instance.MoneyName + " " + "for Roadkill!", Color.yellow);
                    }
                }
                else if (cause.ToString() == "SPARK")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.spark, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    if (Configuration.Instance.UconomyEnabled)
                    {
                        // Do nothing
                    }
                }
                else if (cause.ToString() == "VEHICLE")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.vehicle, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    if (Configuration.Instance.UconomyEnabled)
                    {
                        // Do nothing
                    }
                }
                else if (cause.ToString() == "FOOD")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.food, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    if (Configuration.Instance.UconomyEnabled)
                    {
                        // Do nothing
                    }
                }
                else if (cause.ToString() == "WATER")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.water, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    if (Configuration.Instance.UconomyEnabled)
                    {
                        // Do nothing
                    }
                }
                else if (cause.ToString() == "INFECTION")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.infection, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    if (Configuration.Instance.UconomyEnabled)
                    {
                        // Do nothing
                    }
                }
                else if (cause.ToString() == "BLEEDING")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.bleeding, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    if (Configuration.Instance.UconomyEnabled)
                    {
                        // Do nothing
                    }
                }
                else if (cause.ToString() == "LANDMINE")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.landmine, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    if (Configuration.Instance.UconomyEnabled)
                    {
                        // Do nothing
                    }
                }
                else if (cause.ToString() == "BREATH")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.breath, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    if (Configuration.Instance.UconomyEnabled)
                    {
                        // Do nothing
                    }
                }
                else if (cause.ToString() == "GRENADE")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.grenade, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    if (Configuration.Instance.UconomyEnabled)
                    {
                        // Do nothing
                    }
                }
                else if (cause.ToString() == "FREEZING")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.freezing, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    if (Configuration.Instance.UconomyEnabled)
                    {
                        // Do nothing
                    }
                }
                else if (cause.ToString() == "SENTRY")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.sentry, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    if (Configuration.Instance.UconomyEnabled)
                    {
                        // Do nothing
                    }
                }
                else if (cause.ToString() == "CHARGE")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.charge, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    if (Configuration.Instance.UconomyEnabled)
                    {
                        // Do nothing
                    }
                }
                else if (cause.ToString() == "MISSILE")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.missile, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    if (Configuration.Instance.UconomyEnabled)
                    {
                        // Do nothing
                    }
                }
                else if (cause.ToString() == "BONES")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.bones, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    if (Configuration.Instance.UconomyEnabled)
                    {
                        // Do nothing
                    }
                }
                else if (cause.ToString() == "SPLASH")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.splash, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    if (Configuration.Instance.UconomyEnabled)
                    {
                        // Do nothing
                    }
                }
                else if (cause.ToString() == "ACID")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.acid, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    if (Configuration.Instance.UconomyEnabled)
                    {
                        // Do nothing
                    }
                }
                else if (cause.ToString() == "SPIT")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.spit, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    if (Configuration.Instance.UconomyEnabled)
                    {
                        // Do nothing
                    }
                }
                else if (cause.ToString() == "BURNING")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.fire, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    if (Configuration.Instance.UconomyEnabled)
                    {
                        // Do nothing
                    }
                }
                else if (cause.ToString() == "BURNER")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.fire, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    if (Configuration.Instance.UconomyEnabled)
                    {
                        // Do nothing
                    }
                }
                else if (cause.ToString() == "BOULDER")
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.boulder, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    if (Configuration.Instance.UconomyEnabled)
                    {
                        // Do nothing
                    }
                }

                else if (cause.ToString() == "SUICIDE" && Configuration.Instance.suicidemsg)
                {
                    UnturnedChat.Say(player.CharacterName + " " + Configuration.Instance.suicide, UnturnedChat.GetColorFromName(Configuration.Instance.messagecolour, Color.red));
                    if (Configuration.Instance.UconomyEnabled)
                    {
                        // Do nothing
                    }
                }
                if (limb == ELimb.SKULL)
                {
                    Part = ("head");
                }
                else if (limb == ELimb.SPINE)
                {
                    Part = ("body");
                }
                else if (limb == ELimb.LEFT_ARM || limb == ELimb.RIGHT_ARM || limb == ELimb.LEFT_HAND || limb == ELimb.RIGHT_HAND)
                {
                    Part = ("arm");
                }
                else if (limb == ELimb.LEFT_LEG || limb == ELimb.RIGHT_LEG || limb == ELimb.LEFT_FOOT || limb == ELimb.RIGHT_FOOT)
                {
                    Part = ("leg");
                }
                if (Configuration.Instance.UconomyEnabled)
                {
                    try
                    {
                        if (IsDependencyLoaded("Uconomy"))
                        {
                            ExecuteDependencyCode("Uconomy", delegate(IRocketPlugin plugin)
                            {
                                Uconomy uconomy = (Uconomy)plugin;
                                int value       = 0;
                                if (Part == "head")
                                {
                                    value = Configuration.Instance.Head;
                                }
                                else if (Part == "body")
                                {
                                    value = Configuration.Instance.Body;
                                }
                                else if (Part == "arm")
                                {
                                    value = Configuration.Instance.Arm;
                                }
                                else if (Part == "leg")
                                {
                                    value = Configuration.Instance.Leg;
                                }
                                else if (cause.ToString() == "ROADKILL")
                                {
                                    value = Configuration.Instance.Roadkill;
                                }
                                else
                                {
                                    Rocket.Core.Logging.Logger.LogWarning("");
                                }
                                uconomy.Database.IncreaseBalance(murderer3.CSteamID.ToString(), value);
                            });
                        }
                        else
                        {
                            Rocket.Core.Logging.Logger.LogError("Uconomy not found, loading without it!");
                        }
                    }
                    catch (Exception)
                    {
                    }
                }

                if (Configuration.Instance.ExperienceEnabled)
                {
                    try
                    {
                        uint num1 = 0u;
                        if (Part == "head")
                        {
                            num1 = Configuration.Instance.ExpHead;
                        }
                        else if (Part == "body")
                        {
                            num1 = Configuration.Instance.ExpBody;
                        }
                        else if (Part == "arm")
                        {
                            num1 = Configuration.Instance.ExpArm;
                        }
                        else if (Part == "leg")
                        {
                            num1 = Configuration.Instance.ExpLeg;
                        }
                        else
                        {
                            num1 = 0;
                        }
                        UnturnedPlayer exp = murderer3;
                        exp.Experience = +num1;
                    }
                    catch (Exception)
                    {
                    }
                }
            }
        }
Ejemplo n.º 9
0
 void UnturnedPlayerEvents_OnPlayerDeath(Rocket.Unturned.Player.UnturnedPlayer player, SDG.Unturned.EDeathCause cause, SDG.Unturned.ELimb limb, Steamworks.CSteamID murderer)
 {
     ZaupClearInventoryLib.Instance.ClearInv(player);
     ZaupClearInventoryLib.Instance.ClearClothes(player);
 }