forked from VoxeLibre/mcl_cozy
Print players' actions (sits, lies...) in chat if enabled
enabled by default
This commit is contained in:
parent
dfd072586d
commit
9f8a59f653
13
init.lua
13
init.lua
|
@ -1,4 +1,5 @@
|
||||||
local S = minetest.get_translator(minetest.get_current_modname())
|
local S = minetest.get_translator(minetest.get_current_modname())
|
||||||
|
local mcl_cozy_print_actions = minetest.settings:get_bool("mcl_cozy_print_actions") ~= false
|
||||||
|
|
||||||
minetest.register_globalstep(function(dtime)
|
minetest.register_globalstep(function(dtime)
|
||||||
local players = minetest.get_connected_players()
|
local players = minetest.get_connected_players()
|
||||||
|
@ -27,11 +28,17 @@ minetest.register_chatcommand("sit", {
|
||||||
player:set_physics_override(1, 1, 1)
|
player:set_physics_override(1, 1, 1)
|
||||||
mcl_player.player_attached[name] = false
|
mcl_player.player_attached[name] = false
|
||||||
mcl_player.player_set_animation(player, "stand", 30)
|
mcl_player.player_set_animation(player, "stand", 30)
|
||||||
|
if mcl_cozy_print_status then
|
||||||
|
minetest.chat_send_all("* "..name..S(" got up"))
|
||||||
|
end
|
||||||
else
|
else
|
||||||
player:set_eye_offset({x=0, y=-7, z=2}, {x=0, y=0, z=0})
|
player:set_eye_offset({x=0, y=-7, z=2}, {x=0, y=0, z=0})
|
||||||
player:set_physics_override(0, 0, 0)
|
player:set_physics_override(0, 0, 0)
|
||||||
mcl_player.player_attached[name] = true
|
mcl_player.player_attached[name] = true
|
||||||
mcl_player.player_set_animation(player, "sit", 30)
|
mcl_player.player_set_animation(player, "sit", 30)
|
||||||
|
if mcl_cozy_print_actions then
|
||||||
|
minetest.chat_send_all("* "..name..S(" sat down"))
|
||||||
|
end
|
||||||
mcl_title.set(player, "actionbar", {text=S("Move to stand up"), color="white", stay=60})
|
mcl_title.set(player, "actionbar", {text=S("Move to stand up"), color="white", stay=60})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -46,11 +53,17 @@ minetest.register_chatcommand("lay", {
|
||||||
player:set_physics_override(1, 1, 1)
|
player:set_physics_override(1, 1, 1)
|
||||||
mcl_player.player_attached[name] = false
|
mcl_player.player_attached[name] = false
|
||||||
mcl_player.player_set_animation(player, "stand", 30)
|
mcl_player.player_set_animation(player, "stand", 30)
|
||||||
|
if mcl_cozy_print_actions then
|
||||||
|
minetest.chat_send_all("* "..name..S(" got up"))
|
||||||
|
end
|
||||||
else
|
else
|
||||||
player:set_eye_offset({x=0, y=-13, z=0}, {x=0, y=0, z=0})
|
player:set_eye_offset({x=0, y=-13, z=0}, {x=0, y=0, z=0})
|
||||||
player:set_physics_override(0, 0, 0)
|
player:set_physics_override(0, 0, 0)
|
||||||
mcl_player.player_attached[name] = true
|
mcl_player.player_attached[name] = true
|
||||||
mcl_player.player_set_animation(player, "lay", 0)
|
mcl_player.player_set_animation(player, "lay", 0)
|
||||||
|
if mcl_cozy_print_actions then
|
||||||
|
minetest.chat_send_all("* "..name..S(" lay down"))
|
||||||
|
end
|
||||||
mcl_title.set(player, "actionbar", {text=S("Move to stand up"), color="white", stay=60})
|
mcl_title.set(player, "actionbar", {text=S("Move to stand up"), color="white", stay=60})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,3 +2,6 @@
|
||||||
Sit down=Сесть
|
Sit down=Сесть
|
||||||
Lay down=Лечь
|
Lay down=Лечь
|
||||||
Move to stand up=Двиньтесь чтобы встать
|
Move to stand up=Двиньтесь чтобы встать
|
||||||
|
sits= сел(а)
|
||||||
|
lies= лег(ла)
|
||||||
|
stands up= встал(а)
|
||||||
|
|
|
@ -2,3 +2,6 @@
|
||||||
Sit down=
|
Sit down=
|
||||||
Lay down=
|
Lay down=
|
||||||
Move to stand up=
|
Move to stand up=
|
||||||
|
sits=
|
||||||
|
lies=
|
||||||
|
stands up=
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
# If false then actions (like "* player stands up", in style of /me) won't be printed
|
||||||
|
mcl_cozy_print_actions (Print actions) bool true
|
Loading…
Reference in New Issue