Spawn protection. 5 block radius.

/protectspawn - toggle spawn protection.
This commit is contained in:
Deathmax 2011-06-04 14:21:41 +08:00
parent 474498416d
commit 069c95e2cf
4 changed files with 58 additions and 4 deletions

View file

@ -55,6 +55,7 @@ namespace TShockAPI
TShock.admincommandList.Add("help", new CommandDelegate(Help));
TShock.admincommandList.Add("slap", new CommandDelegate(Slap));
TShock.admincommandList.Add("off-nosave", new CommandDelegate(OffNoSave));
TShock.admincommandList.Add("protectspawn", new CommandDelegate(ProtectSpawn));
TShock.commandList.Add("help", new CommandDelegate(Help));
TShock.commandList.Add("kill", new CommandDelegate(Kill));
}
@ -559,6 +560,12 @@ namespace TShockAPI
else
Tools.SendMessage(args.PlayerID, "Invalid syntax! Proper syntax: /slap <player> [dmg]", new float[] { 255f, 0f, 0f });
}
public static void ProtectSpawn(CommandArgs args)
{
ConfigurationManager.spawnProtect = (ConfigurationManager.spawnProtect == false);
Tools.SendMessage(args.PlayerID, "Spawn is now " + (ConfigurationManager.spawnProtect ? "protected" : "open") + ".");
}
#endregion
}
}