forked from insanity54/matterbridge_player_events
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
48 lines (37 loc) · 1.4 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
local server_chat_name = 'SERVER'
local function get_setting(setting_name, default)
return minetest.settings:get_bool(setting_name) or default
end
print("[MOD] matterbridge_player_events loaded.")
if get_setting("matterbridge_player_events.report_join", true) then
minetest.register_on_joinplayer(
function(player)
yl_matterbridge.send_to_bridge(server_chat_name, player:get_player_name() .. ' joined.')
end
)
end
if get_setting("matterbridge_player_events.report_die", true) then
minetest.register_on_dieplayer(
function(player)
yl_matterbridge.send_to_bridge(server_chat_name, player:get_player_name() .. ' died.')
end
)
end
if get_setting("matterbridge_player_events.report_leave", true) then
minetest.register_on_leaveplayer(
function (player, timed_out)
if timed_out then
yl_matterbridge.send_to_bridge(server_chat_name, player:get_player_name() .. ' timed out.')
else
yl_matterbridge.send_to_bridge(server_chat_name, player:get_player_name() .. ' left.')
end
end
)
end
if get_setting("matterbridge_player_events.report_cheats", false) then
minetest.register_on_cheat(
function (player, cheat)
yl_matterbridge.send_to_bridge(server_chat_name, player:get_player_name() .. ' cheated. (' .. cheat.type .. ')')
end
)
end