summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon <brandon@bremaweb.com>2013-07-01 21:24:25 -0500
committerBrandon <brandon@bremaweb.com>2013-07-01 21:24:25 -0500
commit5f2172a2c9ec7de6ef8824f53b3a0f482ab4699f (patch)
tree99939636c2a0e3cf6f61330d67777e6c9edc9337
parent9a6029ad71b00f96ef825548f49ca640825968a6 (diff)
add sharearea *all so you can retain ownership but allow everybody to edit, chatplus message went land sells
-rw-r--r--chatcommands.lua4
-rw-r--r--init.lua2
-rw-r--r--landsale.lua5
3 files changed, 8 insertions, 3 deletions
diff --git a/chatcommands.lua b/chatcommands.lua
index e40c6ae..3f7eee4 100644
--- a/chatcommands.lua
+++ b/chatcommands.lua
@@ -45,7 +45,7 @@ minetest.register_chatcommand("unclaim", {
})
minetest.register_chatcommand("sharearea", {
- params = "<name>",
+ params = "<name> or *all to retain ownership but allow anyone to build",
description = "shares the current map chunk with <name>",
privs = {interact=true},
func = function(name, param)
@@ -54,7 +54,7 @@ minetest.register_chatcommand("sharearea", {
local owner = landrush.get_owner(pos)
if owner then
if ( owner == name and name ~= param ) or minetest.check_player_privs(name, {landrush=true}) then
- if minetest.env:get_player_by_name(param) then
+ if minetest.env:get_player_by_name(param) or param=="*all" then
claims[landrush.get_chunk(pos)].shared[param] = param
landrush.save_claims()
minetest.chat_send_player(name, param.." may now edit this area.")
diff --git a/init.lua b/init.lua
index 9491997..6d9378a 100644
--- a/init.lua
+++ b/init.lua
@@ -130,7 +130,7 @@ function landrush.can_interact(name, pos)
end
-- if it's the owner or it's shared
- if ( claims[chunk].shared[name] or claims[chunk].owner == name ) then
+ if ( claims[chunk].shared[name] or claims[chunk].owner == name or claims[chunk].shared['*all'] ) then
return true
end
diff --git a/landsale.lua b/landsale.lua
index 245f5dd..1867b98 100644
--- a/landsale.lua
+++ b/landsale.lua
@@ -41,6 +41,11 @@ minetest.register_node("landrush:sale_block",{
landrush.save_claims()
minetest.chat_send_player(claims[chunk].owner, "You now own this claim.")
minetest.remove_node(pos)
+
+ if ( chatplus ) then
+ table.insert(chatplus.players[owner].messages,"mail from <LandRush>: "..name.." has bought your claim at "..minetest.pos_to_string(pos).." for "..tostring(price))
+ end
+
else
minetest.chat_send_player(name,"Money transfer failed: "..transfer)
end