From 10d0c3ca45a8232640ff636076fc7959911b1a21 Mon Sep 17 00:00:00 2001 From: Aleksandr Date: Sat, 6 Jan 2024 16:06:00 +0500 Subject: [PATCH] Initial commit --- init.lua | 32 ++++++++++++++++++++++++++++++++ locale/towns.ru.tr | 9 +++++++++ mod.conf | 5 +++++ 3 files changed, 46 insertions(+) create mode 100644 init.lua create mode 100644 locale/towns.ru.tr create mode 100644 mod.conf diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..c48fa44 --- /dev/null +++ b/init.lua @@ -0,0 +1,32 @@ +local S = minetest.get_translator("towns") + +local towns_list = {} + +local city_pos = { x = -12003, y = 22, z = -7498 } +table.insert(towns_list, S("The city built by the player H743")..S(" | command - ").."/city") + +minetest.register_chatcommand("city", { + description = S("Go to the city built by the player H743"), + privs = { home = true }, + func = function(name) + local player = minetest.get_player_by_name(name) + if (player) then + player:setpos(city_pos) + minetest.chat_send_player(name,minetest.colorize("cyan", S("Welcome to the City!"))) + end + end, +}) + +minetest.register_chatcommand("list_towns", { + description = S("List of server towns"), + privs = { + home = true, + }, + func = function(name) + minetest.chat_send_player(name, minetest.colorize("cyan", S("Towns:"))) + for i = 1, #towns_list do + minetest.chat_send_player(name, i .. " - " .. towns_list[i]) + end + return true, S("Total number of towns:") .." ".. #towns_list + end +}) \ No newline at end of file diff --git a/locale/towns.ru.tr b/locale/towns.ru.tr new file mode 100644 index 0000000..91e599c --- /dev/null +++ b/locale/towns.ru.tr @@ -0,0 +1,9 @@ +# textdomain: towns + +The city built by the player H743=Город, построенный игроком H743 + | command - = | комманда - +Go to the city built by the player H743=Отправиться в город, построенный игроком H743 +Welcome to the City!=Добро пожаловать в City! +List of server towns=Список городов сервера +Towns:=Города: +Total number of towns:=Всего городов на сервере: \ No newline at end of file diff --git a/mod.conf b/mod.conf new file mode 100644 index 0000000..7a7d076 --- /dev/null +++ b/mod.conf @@ -0,0 +1,5 @@ +name = towns +description = Add chat teleport command to different towns of minetestserver.ru +depends = default +min_minetest_version = 5.7 +title = MTSR towns \ No newline at end of file