Adds canbuild permission - requires permission to consider manipulating tiles.

Closes #221
This commit is contained in:
Deathmax 2011-07-08 21:43:40 +08:00
parent aa511e003b
commit 811f7ab1dc
2 changed files with 19 additions and 2 deletions

View file

@ -242,6 +242,11 @@ namespace TShockAPI
int x = args.Data.ReadInt32();
int y = args.Data.ReadInt32();
byte tiletype = args.Data.ReadInt8();
if (!args.Player.Group.HasPermission("canbuild"))
{
args.Player.SendMessage("You do not have permission to build!", Color.Red);
return true;
}
if (type == 1 || type == 3)
{
int plyX = Math.Abs(args.Player.TileX);
@ -453,6 +458,12 @@ namespace TShockAPI
}
}
if (!args.Player.Group.HasPermission("canbuild"))
{
args.Player.SendMessage("You do not have permission to build!", Color.Red);
return true;
}
if (lava && !args.Player.Group.HasPermission("canlava"))
{
args.Player.SendMessage("You do not have permission to use lava", Color.Red);
@ -512,6 +523,11 @@ namespace TShockAPI
Tools.ForceKick(args.Player, string.Format("Tile Kill abuse ({0})", Main.tile[tilex, tiley].type));
return true;
}
if (!args.Player.Group.HasPermission("canbuild"))
{
args.Player.SendMessage("You do not have permission to build!", Color.Red);
return true;
}
if (!args.Player.Group.HasPermission("editspawn") && RegionManager.InProtectedArea(tilex, tiley, Tools.GetPlayerIP(args.Player.Name)))
{
args.Player.SendMessage("Region protected from changes.", Color.Red);