don't teleport if on a quest
parent
74e761ce91
commit
8039cdc83e
19
center.lua
19
center.lua
|
@ -1,12 +1,17 @@
|
||||||
|
|
||||||
|
local has_epic = minetest.get_modpath("epic")
|
||||||
|
|
||||||
|
|
||||||
local function teleport_to_spawn(name)
|
local function teleport_to_spawn(name)
|
||||||
local player = minetest.get_player_by_name(name)
|
if has_epic and epic.get_state(name) then
|
||||||
if player == nil then
|
-- no teleporting while on a quest
|
||||||
-- just a check to prevent the server crashing
|
minetest.chat_send_player(name, "i'm sorry i can't do that dave")
|
||||||
return false
|
return
|
||||||
end
|
end
|
||||||
player:setpos({ x=0, y=0, z=0 })
|
|
||||||
minetest.chat_send_player(name, "Teleported to center!")
|
local player = minetest.get_player_by_name(name)
|
||||||
|
player:setpos({ x=0, y=0, z=0 })
|
||||||
|
minetest.chat_send_player(name, "Teleported to center!")
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_chatcommand("center", {
|
minetest.register_chatcommand("center", {
|
||||||
|
|
Loading…
Reference in New Issue