1
0
forked from MTSR/jail

saved the notice for the convicted person

This commit is contained in:
Vitaliy Olkhin 2024-02-15 15:12:06 +05:00 committed by Koldun
parent 58daf49b82
commit 5e5ab53707
Signed by: Koldun
GPG Key ID: 53DE683337F5D25F

View File

@ -161,6 +161,7 @@ minetest.register_globalstep(function(dtime)
local max_pos_y = jailpos.x + jail.escape_boundary local max_pos_y = jailpos.x + jail.escape_boundary
local max_pos_z = jailpos.z + jail.escape_boundary local max_pos_z = jailpos.z + jail.escape_boundary
local min_pos_z = jailpos.z - jail.escape_boundary local min_pos_z = jailpos.z - jail.escape_boundary
local msg = ''
-- every 5 seconds -- every 5 seconds
if timer > os.time() then if timer > os.time() then
@ -177,17 +178,18 @@ minetest.register_globalstep(function(dtime)
if (max_pos_x < pos.x or pos.x < min_pos_x or max_pos_z < pos.z or pos.z < min_pos_z or pos.y > max_pos_y) if (max_pos_x < pos.x or pos.x < min_pos_x or max_pos_z < pos.z or pos.z < min_pos_z or pos.y > max_pos_y)
and pos.y > lower_prison_limit then and pos.y > lower_prison_limit then
object:set_pos(jailpos) object:set_pos(jailpos)
jail.private_messages_with_privilege({ban = true}, msg = minetest.colorize("red", S("Escape attempt: ") .. prisoners_list[i])
minetest.colorize("red", S("Escape attempt: ") .. prisoners_list[i])) jail.private_messages_with_privilege({ban = true}, msg)
minetest.chat_send_player(prisoners_list[i], msg)
jail.set_permissions_for_the_jail(prisoners_list[i]) jail.set_permissions_for_the_jail(prisoners_list[i])
end end
--Проверка если игрок копает в низ по кординатам тюрьмы --Проверка если игрок копает в низ по кординатам тюрьмы
if pos.y < lower_prison_limit and pos.y > forced_labor then if pos.y < lower_prison_limit and pos.y > forced_labor then
object:set_pos(jailpos) object:set_pos(jailpos)
jail.private_messages_with_privilege({ban = true}, msg = minetest.colorize("red", prisoners_list[i] .. S(": He dug under the prison"))
minetest.colorize("red", prisoners_list[i] .. S(": He dug under the prison"))) jail.private_messages_with_privilege({ban = true}, msg)
minetest.chat_send_all() minetest.chat_send_player(prisoners_list[i], msg)
jail.set_permissions_for_the_jail(prisoners_list[i]) jail.set_permissions_for_the_jail(prisoners_list[i])
end end