From 91a625d9d47f2049bdc2d855b22f470c97be2474 Mon Sep 17 00:00:00 2001 From: bark10 Date: Wed, 28 Dec 2016 16:46:08 +0100 Subject: [PATCH] Added notification for death coordinates Players will now receive a PM from the server informing what coordinates their bones are located. --- init.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/init.lua b/init.lua index 43ab6f5..c85404f 100644 --- a/init.lua +++ b/init.lua @@ -105,6 +105,17 @@ minetest.register_on_dieplayer(function(player) end) ]]-- +-- PM from server with death coordinates +minetest.register_on_dieplayer(function(player) + local name=player:get_player_name() + local playerpos = player:getpos() + local x = tostring(math.floor(playerpos["x"])) + local y = tostring(math.floor(playerpos["y"])) + local z = tostring(math.floor(playerpos["z"])) + minetest.chat_send_player(player:get_player_name(),"PM from server: Your bones are located at " .. x .. ", " .. y .. ", " .. z .. ". You'd better go and get them before someone else does!") + print("****** " .. player:get_player_name() .. " died at " .. x .. ", " .. y .. ", " .. z .. " ******") +end) + -- Add "PLAYER KILLED PLAYER"-messages minetest.register_on_punchplayer(function(player, hitter) if not (player or hitter) then