using System; using System.IO; using System.Text; using System.Reflection; using System.Collections.Generic; using System.Data; using System.Text.RegularExpressions; using System.Threading; using System.Timers; using PRoCon.Core; using PRoCon.Core.Plugin; using PRoCon.Core.Plugin.Commands; using PRoCon.Core.Players; using PRoCon.Core.Players.Items; using PRoCon.Core.Battlemap; using PRoCon.Core.Maps; using PRoCon.Core.HttpServer; namespace PRoConEvents { public class CAutoRestarter : PRoConPluginAPI, IPRoConPluginInterface { private bool restarting; private System.Timers.Timer RestartTimer; private bool autoRestartEnable; private int autoRestartDelay; private bool m_isPluginEnabled; public CAutoRestarter() { this.restarting = false; this.autoRestartEnable = false; this.autoRestartDelay = 15; this.m_isPluginEnabled = false; } public string GetPluginName() { return "Automatic Restarter"; } public string GetPluginVersion() { return "1.0"; } public string GetPluginAuthor() { return "Flash_Hit"; } public string GetPluginWebsite() { return "battlelog.battlefield.com/bf3/platoon/3307924585064219629/"; } public string GetPluginDescription() { return @"
At the end of a round you can perform an automatic restart.
You can set a delay to restart after X seconds.
Enabled
Enables/Disables AutoRestart
"; } public void OnPluginLoaded(string strHostName, string strPort, string strPRoConVersion) { this.RegisterEvents(this.GetType().Name, "OnRoundOver"); } public void OnPluginEnable() { this.ExecuteCommand("procon.protected.pluginconsole.write", "^bAutomatic Restarter ^2Enabled!"); this.m_isPluginEnabled = true; } public void OnPluginDisable() { this.ExecuteCommand("procon.protected.pluginconsole.write", "^bAutomatic Restarter ^1Disabled!" ); this.m_isPluginEnabled = false; } public ListDelay
Number of seconds before restarting. Default 15 seconds (It will show '45 seconds left' on Scoreboard).