Esempio n. 1
0
 public void OnAdminQuery(AdminQueryEvent ev)
 {
     if (ev.Query != "REQUEST_DATA PLAYER_LIST SILENT")
     {
         AdminToolbox.WriteToLog(new string[] { ev.Admin.Name + " used command: \"" + ev.Query + "\"" }, LogHandlers.ServerLogType.RemoteAdminActivity);
     }
 }
Esempio n. 2
0
 public override void OnEnable()
 {
     plugin = this;
     WriteVersionToFile();
     //CheckCurrVersion(this, this.Details.version);
     if (isColored)
     {
         this.Info(this.Details.name + " v." + this.Details.version + " - @#fg=Green;Enabled@#fg=Default;");
     }
     else
     {
         this.Info(this.Details.name + " v." + this.Details.version + " - Enabled");
     }
     _roundStartTime = DateTime.Now.Year.ToString() + "-" + ((DateTime.Now.Month >= 10) ? DateTime.Now.Month.ToString() : ("0" + DateTime.Now.Month.ToString())) + "-" + ((DateTime.Now.Day >= 10) ? DateTime.Now.Day.ToString() : ("0" + DateTime.Now.Day.ToString())) + " " + ((DateTime.Now.Hour >= 10) ? DateTime.Now.Hour.ToString() : ("0" + DateTime.Now.Hour.ToString())) + "." + ((DateTime.Now.Minute >= 10) ? DateTime.Now.Minute.ToString() : ("0" + DateTime.Now.Minute.ToString())) + "." + ((DateTime.Now.Second >= 10) ? DateTime.Now.Second.ToString() : ("0" + DateTime.Now.Second.ToString()));
     warpVectors     = new Dictionary <string, Vector>(presetWarps);
     AdminToolbox.WriteToLog(new string[] { "\"Plugin Started\"" }, LogHandlers.ServerLogType.Misc);
 }
Esempio n. 3
0
        public void OnPlayerDie(PlayerDeathEvent ev)
        {
            int[] nineTailsTeam = { (int)Team.MTF, (int)Team.RSC }, chaosTeam = { (int)Team.CHI, (int)Team.CDP };

            AdminToolbox.AddSpesificPlayer(ev.Player);
            AdminToolbox.AddSpesificPlayer(ev.Killer);

            if (AdminToolbox.playerDeathPos.ContainsKey(ev.Player.SteamId))
            {
                AdminToolbox.playerDeathPos[ev.Player.SteamId] = ev.Player.GetPosition();
            }

            if (ev.Player.Name == "Server" || ev.Killer.Name == "Server")
            {
                ev.SpawnRagdoll = false; return;
            }
            if (AdminToolbox.playerStats.ContainsKey(ev.Player.SteamId))
            {
                AdminToolbox.playerStats[ev.Player.SteamId][2]++;
            }
            switch ((int)ev.Player.TeamRole.Role)
            {
            case 3:
                if (LastAttacked.last106Damage == DamageType.LURE || LastAttacked.last106Damage == DamageType.CONTAIN)
                {
                    ev.SpawnRagdoll = false;
                }
                goto default;

            default:
                if (AdminToolbox.isRoundFinished)
                {
                    return;
                }

                if (!(ConfigManager.Manager.Config.GetBoolValue("admintoolbox_debug_scp_and_self_killed", false, false)) && ev.Player.Name == ev.Killer.Name)
                {
                    return;
                }
                if (nineTailsTeam.Contains((int)ev.Player.TeamRole.Team) && nineTailsTeam.Contains((int)ev.Killer.TeamRole.Team))
                {
                    if (AdminToolbox.playerStats.ContainsKey(ev.Killer.SteamId))
                    {
                        AdminToolbox.playerStats[ev.Killer.SteamId][1]++;
                    }
                    if (ConfigManager.Manager.Config.GetBoolValue("admintoolbox_debug_friendly_kill", true, false))
                    {
                        if ((LastAttacked.lastDamageType == DamageType.FRAG) && (ev.Player.SteamId == LastAttacked.lastVictim.SteamId && ev.Killer.SteamId == LastAttacked.lastAttacker.SteamId))
                        {
                            if (AdminToolbox.isColored)
                            {
                                plugin.Info(ev.Killer.TeamRole.Name + " @#fg=Yellow;" + ev.Killer.Name + "@#fg=Red; granaded @#fg=Default;fellow @#fg=Blue;" + ev.Player.TeamRole.Name + "@#fg=Yellow; " + ev.Player.Name + "@#fg=Default;");
                            }
                            else
                            {
                                plugin.Info(ev.Killer.TeamRole.Name + " " + ev.Killer.Name + " granaded fellow " + ev.Player.TeamRole.Name + " " + ev.Player.Name);
                            }
                            AdminToolbox.WriteToLog(new string[] { ev.Killer.TeamRole.Name + " " + ev.Killer.Name + " granaded fellow " + ev.Player.TeamRole.Name + " " + ev.Player.Name }, LogHandlers.ServerLogType.TeamKill);
                            LastAttacked.lastAttacker   = null;
                            LastAttacked.lastVictim     = null;
                            LastAttacked.lastDamageType = DamageType.NONE;
                        }
                        else
                        {
                            if (AdminToolbox.isColored)
                            {
                                plugin.Info(ev.Killer.TeamRole.Name + " @#fg=Yellow;" + ev.Killer.Name + "@#fg=Red; killed fellow @#fg=Blue;" + ev.Player.TeamRole.Name + " @#fg=Yellow;" + ev.Player.Name + "@#fg=Default;");
                            }
                            else
                            {
                                plugin.Info(ev.Killer.TeamRole.Name + " " + ev.Killer.Name + " killed fellow " + ev.Player.TeamRole.Name + " " + ev.Player.Name);
                            }
                            AdminToolbox.WriteToLog(new string[] { ev.Killer.TeamRole.Name + " " + ev.Killer.Name + " killed fellow " + ev.Player.TeamRole.Name + " " + ev.Player.Name }, LogHandlers.ServerLogType.TeamKill);
                        }
                    }
                }
                else if (chaosTeam.Contains((int)ev.Player.TeamRole.Team) && chaosTeam.Contains((int)ev.Killer.TeamRole.Team))
                {
                    if (AdminToolbox.playerStats.ContainsKey(ev.Killer.SteamId))
                    {
                        AdminToolbox.playerStats[ev.Killer.SteamId][1]++;
                    }
                    if (ConfigManager.Manager.Config.GetBoolValue("admintoolbox_debug_friendly_kill", true, false))
                    {
                        if ((LastAttacked.lastDamageType == DamageType.FRAG) && (ev.Player.SteamId == LastAttacked.lastVictim.SteamId && ev.Killer.SteamId == LastAttacked.lastAttacker.SteamId))
                        {
                            if (AdminToolbox.isColored)
                            {
                                plugin.Info(ev.Killer.TeamRole.Name + " @#fg=Yellow;" + ev.Killer.Name + "@#fg=Red; granaded @#fg=Default;fellow @#fg=Green;" + ev.Player.TeamRole.Name + " @#fg=Yellow;" + ev.Player.Name + "@#fg=Default;");
                            }
                            else
                            {
                                plugin.Info(ev.Killer.TeamRole.Name + " " + ev.Killer.Name + " granaded fellow " + ev.Player.TeamRole.Name + " " + ev.Player.Name);
                            }
                            AdminToolbox.WriteToLog(new string[] { ev.Killer.TeamRole.Name + " " + ev.Killer.Name + " granaded fellow " + ev.Player.TeamRole.Name + " " + ev.Player.Name }, LogHandlers.ServerLogType.TeamKill);
                            LastAttacked.lastAttacker   = null;
                            LastAttacked.lastVictim     = null;
                            LastAttacked.lastDamageType = DamageType.NONE;
                        }
                        else
                        {
                            if (AdminToolbox.isColored)
                            {
                                plugin.Info(ev.Killer.TeamRole.Name + " @#fg=Yellow;" + ev.Killer.Name + "@#fg=Red; killed fellow @#fg=Green;" + ev.Player.TeamRole.Name + " @#fg=Yellow;" + ev.Player.Name + "@#fg=Default;");
                            }
                            else
                            {
                                plugin.Info(ev.Killer.TeamRole.Name + " " + ev.Killer.Name + " killed fellow " + ev.Player.TeamRole.Name + " " + ev.Player.Name);
                            }
                            AdminToolbox.WriteToLog(new string[] { ev.Killer.TeamRole.Name + " " + ev.Killer.Name + " killed fellow " + ev.Player.TeamRole.Name + " " + ev.Player.Name }, LogHandlers.ServerLogType.TeamKill);
                        }
                    }
                }
                else if ((ConfigManager.Manager.Config.GetBoolValue("admintoolbox_debug_player_kill", false, false)))
                {
                    plugin.Info(ev.Killer.Name + " killed: " + ev.Player.Name);
                    if (AdminToolbox.playerStats.ContainsKey(ev.Killer.SteamId))
                    {
                        AdminToolbox.playerStats[ev.Killer.SteamId][0]++;
                    }
                    AdminToolbox.WriteToLog(new string[] { ev.Killer.TeamRole.Name + " " + ev.Killer.Name + " killed " + ev.Player.TeamRole.Name + " " + ev.Player.Name }, LogHandlers.ServerLogType.KillLog);
                }
                else
                if (AdminToolbox.playerStats.ContainsKey(ev.Killer.SteamId))
                {
                    AdminToolbox.playerStats[ev.Killer.SteamId][0]++;
                }
                break;
            }
        }
Esempio n. 4
0
        public void OnPlayerDie(PlayerDeathEvent ev)
        {
            int[] nineTailsTeam = { (int)Team.MTF, (int)Team.RSC }, chaosTeam = { (int)Team.CHI, (int)Team.CDP };

            AdminToolbox.AddMissingPlayerVariables(new List <Player> {
                ev.Player, ev.Killer
            });

            if (ev.Player.Name == "Server" || ev.Killer.Name == "Server" || ev.Player.Name == string.Empty)
            {
                ev.SpawnRagdoll = false; return;
            }

            bool isFriendlyKill()
            {
                if (nineTailsTeam.Contains((int)ev.Player.TeamRole.Team) && nineTailsTeam.Contains((int)ev.Killer.TeamRole.Team))
                {
                    return(true);
                }
                else if (chaosTeam.Contains((int)ev.Player.TeamRole.Team) && chaosTeam.Contains((int)ev.Killer.TeamRole.Team))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }

            switch ((int)ev.Player.TeamRole.Role)
            {
            case 3:
                if (ev.DamageTypeVar == DamageType.LURE || ev.DamageTypeVar == DamageType.CONTAIN)
                {
                    ev.SpawnRagdoll = false;
                }
                goto default;

            default:
                if (AdminToolbox.isRoundFinished)
                {
                    break;
                }
                if (AdminToolbox.playerdict.ContainsKey(ev.Player.SteamId))
                {
                    AdminToolbox.playerdict[ev.Player.SteamId].Deaths++;
                }
                if (!(ConfigManager.Manager.Config.GetBoolValue("admintoolbox_debug_scp_and_self_killed", false, false)) && ev.Player.Name == ev.Killer.Name)
                {
                    return;
                }
                if (isFriendlyKill())
                {
                    string keyWord = (ev.DamageTypeVar == DamageType.FRAG) ? "granaded" : "killed";
                    if (AdminToolbox.playerdict.ContainsKey(ev.Killer.SteamId))
                    {
                        AdminToolbox.playerdict[ev.Killer.SteamId].TeamKills++;
                    }
                    if (ConfigManager.Manager.Config.GetBoolValue("admintoolbox_debug_friendly_kill", true, false))
                    {
                        if (AdminToolbox.isColored)
                        {
                            plugin.Info(Colors.ColoredRole(ev.Killer) + " @#fg=Yellow;" + ev.Killer.Name + "@#fg=DarkRed; " + keyWord + " fellow @#fg=Default;" + Colors.ColoredRole(ev.Player) + "@#fg=Yellow; " + ev.Player.Name + "@#fg=Default;");
                        }
                        else
                        {
                            plugin.Info(ev.Killer.TeamRole.Name + " " + ev.Killer.Name + " " + keyWord + " fellow " + ev.Player.TeamRole.Name + " " + ev.Player.Name);
                        }
                    }
                    AdminToolbox.WriteToLog(new string[] { ev.Killer.TeamRole.Name + " " + ev.Killer.Name + " " + keyWord + " fellow " + ev.Player.TeamRole.Name + " " + ev.Player.Name }, LogHandlers.ServerLogType.TeamKill);
                }                         // Colors.ColoredRole()
                else
                {
                    if (ConfigManager.Manager.Config.GetBoolValue("admintoolbox_debug_player_kill", false, false))
                    {
                        plugin.Info(ev.Killer.Name + " killed: " + ev.Player.Name);
                    }
                    if (AdminToolbox.playerdict.ContainsKey(ev.Killer.SteamId))
                    {
                        AdminToolbox.playerdict[ev.Killer.SteamId].Kills++;
                    }
                    AdminToolbox.WriteToLog(new string[] { ev.Killer.TeamRole.Name + " " + ev.Killer.Name + " killed " + ev.Player.TeamRole.Name + " " + ev.Player.Name }, LogHandlers.ServerLogType.KillLog);
                }
                break;
            }
        }