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);

View file

@ -39,10 +39,11 @@
#ignoregriefdetection - allow player to grief (use explosives, water, lava even if they dont have premission to)
#usebanneditem - allows player to use banned items
#manageusers - Grab player info
#whisper - allow a player to whisper to other players
#whisper - allow player to whisper to other players
#adminchat - Colors and adds a prefix to the player's chats.
#canbuild - allow player to build (does not bypass other checks)
default null canwater canlava warp
default null canwater canlava warp canbuild
vip default reservedslot
newadmin default kick editspawn reservedslot
admin newadmin ban unban whitelist causeevents spawnboss spawnmob managewarp time tp pvpfun kill logs immunetokick tphere