fetch global settings for spawnpoint location
This commit is contained in:
parent
306d3d5676
commit
a1140159ed
15
commands.lua
15
commands.lua
@ -1,15 +1,14 @@
|
|||||||
spawn = {x = -110.0, y = 25.9, z = -202.0}
|
|
||||||
|
|
||||||
minetest.register_on_chat_message(function(name, message, playername, player)
|
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:sub(0, #cmd) == cmd then
|
||||||
if message == '/spawn' then
|
if message == '/spawn' then
|
||||||
local player = minetest.env:get_player_by_name(name)
|
local player = minetest.env:get_player_by_name(name)
|
||||||
minetest.chat_send_player(player:get_player_name(), "Teleporting to spawn...")
|
local spawnPoint = minetest.setting_get("static_spawnpoint")
|
||||||
player:setpos(spawn)
|
minetest.get_player_by_name(name):setpos(minetest.string_to_pos(spawnPoint))
|
||||||
return true --deds to sfan5
|
minetest.chat_send_player(name, "Teleported to spawn!")
|
||||||
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local cmd ="/away"
|
local cmd ="/away"
|
||||||
if message:sub(0, #cmd) == cmd then
|
if message:sub(0, #cmd) == cmd then
|
||||||
if message == '/away' then
|
if message == '/away' then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user