From d5239404c53d5ad1e7f18fafb74bc58debb38eb7 Mon Sep 17 00:00:00 2001 From: Aleksandr Avdeev Date: Sun, 21 Jan 2024 02:03:25 +0500 Subject: [PATCH] replace spawn point --- init.lua | 16 ++++++++++++++++ locale/towns.ru.tr | 4 +++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index c48fa44..8cfa35b 100644 --- a/init.lua +++ b/init.lua @@ -1,7 +1,9 @@ local S = minetest.get_translator("towns") local towns_list = {} +-- static spawn position +local central_spawn = { x = 206.7,y = 6,z = -84.2 } local city_pos = { x = -12003, y = 22, z = -7498 } table.insert(towns_list, S("The city built by the player H743")..S(" | command - ").."/city") @@ -29,4 +31,18 @@ minetest.register_chatcommand("list_towns", { end return true, S("Total number of towns:") .." ".. #towns_list end +}) + +minetest.register_chatcommand("spawn", { + description = S("Go to central Spawn"), + privs = {home = true}, + func = function(name) + + local player = minetest.get_player_by_name(name) + + if player~=nil then + player:set_pos(central_spawn) + minetest.chat_send_player(name,minetest.colorize("cyan", S("Welcome to central Spawn!"))) + end + end }) \ No newline at end of file diff --git a/locale/towns.ru.tr b/locale/towns.ru.tr index 91e599c..3fb568d 100644 --- a/locale/towns.ru.tr +++ b/locale/towns.ru.tr @@ -6,4 +6,6 @@ Go to the city built by the player H743=Отправиться в город, п Welcome to the City!=Добро пожаловать в City! List of server towns=Список городов сервера Towns:=Города: -Total number of towns:=Всего городов на сервере: \ No newline at end of file +Total number of towns:=Всего городов на сервере: +Go to central Spawn=Отправиться на центральный Спавн +Welcome to central Spawn!=Добро пожаловать на центральный Спавн! \ No newline at end of file