fetch global settings for spawnpoint location

This commit is contained in:
tchncs 2016-06-08 16:19:23 +02:00
parent 306d3d5676
commit a1140159ed

View File

@ -1,15 +1,14 @@
spawn = {x = -110.0, y = 25.9, z = -202.0}
minetest.register_on_chat_message(function(name, message, playername, player)
local cmd = "/spawn"
local cmd ="/spawn"
if message:sub(0, #cmd) == cmd then
if message == '/spawn' then
local player = minetest.env:get_player_by_name(name)
minetest.chat_send_player(player:get_player_name(), "Teleporting to spawn...")
player:setpos(spawn)
return true --deds to sfan5
local player = minetest.env:get_player_by_name(name)
local spawnPoint = minetest.setting_get("static_spawnpoint")
minetest.get_player_by_name(name):setpos(minetest.string_to_pos(spawnPoint))
minetest.chat_send_player(name, "Teleported to spawn!")
return true
end
end
end
local cmd ="/away"
if message:sub(0, #cmd) == cmd then
if message == '/away' then