Added /broadcast and /bc

Admin chat color and prefix are now optional
This commit is contained in:
Lucas Nicodemus 2011-07-01 03:35:24 -06:00
parent d62068eacf
commit a66d016fcb
4 changed files with 21 additions and 1 deletions

View file

@ -146,6 +146,8 @@ namespace TShockAPI
ChatCommands.Add(new Command("displaylogs", "logs", Rules));
ChatCommands.Add(new Command("user", "manageusers", ManageUsers));
ChatCommands.Add(new Command("login", "", AttemptLogin));
ChatCommands.Add(new Command("broadcast", "cfg", Broadcast));
ChatCommands.Add(new Command("bc", "cfg", Broadcast));
if (ConfigurationManager.DistributationAgent != "terraria-online")
{
ChatCommands.Add(new Command("kill", "kill", Kill));
@ -516,6 +518,19 @@ namespace TShockAPI
#region Server Maintenence Commands
private static void Broadcast(CommandArgs args)
{
string message = "";
for (int i = 0; i < args.Parameters.Count; i++)
{
message += args.Parameters[i];
}
Tools.Broadcast("(Server Broadcast) " + message, Color.Red);
return;
}
private static void Off(CommandArgs args)
{
Tools.ForceKickAll("Server shutting down!");