-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
66 lines (59 loc) · 1.82 KB
/
init.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
activate = true
minetest.register_chatcommand(
"death",
{
description = "Enable or disable death coordinates",
params = "<true> | <false>",
privs = {ban = true},
func = function(name, param)
if param == "true" then
activate = true
minetest.chat_send_all(minetest.colorize("#00FF00", "*** [Server]: Death coordinates are enabled!"))
music =
minetest.sound_play(
"notify",
{
loop = false,
gain = 1.0
}
)
end
if param == "false" then
activate = false
minetest.chat_send_all(minetest.colorize("#FF0000", "*** [Server]: Death coordinates are disabled!"))
music =
minetest.sound_play(
"notify",
{
loop = false,
gain = 1.0
}
)
end
end
}
)
minetest.register_on_dieplayer(
function(player)
if activate == true then
local pname = player:get_player_name()
local pos = player:getpos()
pos.x = math.floor(pos.x)
pos.y = math.floor(pos.y)
pos.z = math.floor(pos.z)
minetest.chat_send_player(
pname,
core.get_color_escape_sequence("#FF0000") ..
"*** [Server] - Last Dead At: " .. pos.x .. ", " .. pos.y .. ", " .. pos.z
)
music =
minetest.sound_play(
"die",
{
loop = false,
gain = 1.0
}
)
end
end
)