From 5f2172a2c9ec7de6ef8824f53b3a0f482ab4699f Mon Sep 17 00:00:00 2001 From: Brandon Date: Mon, 1 Jul 2013 21:24:25 -0500 Subject: add sharearea *all so you can retain ownership but allow everybody to edit, chatplus message went land sells --- chatcommands.lua | 4 ++-- init.lua | 2 +- landsale.lua | 5 +++++ 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 = "", + params = " or *all to retain ownership but allow anyone to build", description = "shares the current map chunk with ", 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 : "..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 -- cgit v1.2.3