Adds canbuild permission - requires permission to consider manipulating tiles.
Closes #221
This commit is contained in:
parent
aa511e003b
commit
811f7ab1dc
2 changed files with 19 additions and 2 deletions
|
|
@ -242,6 +242,11 @@ namespace TShockAPI
|
||||||
int x = args.Data.ReadInt32();
|
int x = args.Data.ReadInt32();
|
||||||
int y = args.Data.ReadInt32();
|
int y = args.Data.ReadInt32();
|
||||||
byte tiletype = args.Data.ReadInt8();
|
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)
|
if (type == 1 || type == 3)
|
||||||
{
|
{
|
||||||
int plyX = Math.Abs(args.Player.TileX);
|
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"))
|
if (lava && !args.Player.Group.HasPermission("canlava"))
|
||||||
{
|
{
|
||||||
args.Player.SendMessage("You do not have permission to use lava", Color.Red);
|
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));
|
Tools.ForceKick(args.Player, string.Format("Tile Kill abuse ({0})", Main.tile[tilex, tiley].type));
|
||||||
return true;
|
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)))
|
if (!args.Player.Group.HasPermission("editspawn") && RegionManager.InProtectedArea(tilex, tiley, Tools.GetPlayerIP(args.Player.Name)))
|
||||||
{
|
{
|
||||||
args.Player.SendMessage("Region protected from changes.", Color.Red);
|
args.Player.SendMessage("Region protected from changes.", Color.Red);
|
||||||
|
|
|
||||||
|
|
@ -39,10 +39,11 @@
|
||||||
#ignoregriefdetection - allow player to grief (use explosives, water, lava even if they dont have premission to)
|
#ignoregriefdetection - allow player to grief (use explosives, water, lava even if they dont have premission to)
|
||||||
#usebanneditem - allows player to use banned items
|
#usebanneditem - allows player to use banned items
|
||||||
#manageusers - Grab player info
|
#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.
|
#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
|
vip default reservedslot
|
||||||
newadmin default kick editspawn reservedslot
|
newadmin default kick editspawn reservedslot
|
||||||
admin newadmin ban unban whitelist causeevents spawnboss spawnmob managewarp time tp pvpfun kill logs immunetokick tphere
|
admin newadmin ban unban whitelist causeevents spawnboss spawnmob managewarp time tp pvpfun kill logs immunetokick tphere
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue