mirror of
https://github.com/4Evergreen4/death_messages.git
synced 2025-03-20 19:00:17 +01:00
Added notification for death coordinates
Players will now receive a PM from the server informing what coordinates their bones are located.
This commit is contained in:
parent
2fb5a8e907
commit
91a625d9d4
11
init.lua
11
init.lua
@ -105,6 +105,17 @@ minetest.register_on_dieplayer(function(player)
|
|||||||
end)
|
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
|
-- Add "PLAYER KILLED PLAYER"-messages
|
||||||
minetest.register_on_punchplayer(function(player, hitter)
|
minetest.register_on_punchplayer(function(player, hitter)
|
||||||
if not (player or hitter) then
|
if not (player or hitter) then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user