Add "enable_immediate_teleport"

This commit is contained in:
Panquesito7 2019-07-27 19:41:04 -05:00 committed by GitHub
parent 65cad92d7d
commit 07128f83c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -125,7 +125,7 @@ function clear_tphr_list(name)
end
function tpr_send(sender, receiver)
if minetest.check_player_privs(sender, {tp_admin = true}) then
if minetest.check_player_privs(sender, {tp_admin = true}) and enable_immediate_teleport then
if receiver == "" then
minetest.chat_send_player(sender, S("Usage: /tpr <Player name>"))
return
@ -154,7 +154,6 @@ function tpr_send(sender, receiver)
minetest.chat_send_player(sender, S("Teleport request sent! It will timeout in @1 seconds", timeout_delay))
-- Write name values to list and clear old values.
if not minetest.check_player_privs(sender, {tp_admin = true}) then
tpr_list[receiver] = sender
-- Teleport timeout delay
minetest.after(timeout_delay, function(name)
@ -166,10 +165,9 @@ function tpr_send(sender, receiver)
end
end, receiver)
end
end
function tphr_send(sender, receiver)
if minetest.check_player_privs(sender, {tp_admin = true}) then
if minetest.check_player_privs(sender, {tp_admin = true}) and enable_immediate_teleport then
if receiver == "" then
minetest.chat_send_player(sender, S("Usage: /tphr <Player name>"))
return
@ -197,7 +195,6 @@ function tphr_send(sender, receiver)
minetest.chat_send_player(sender, S("Teleport request sent! It will timeout in @1 seconds", timeout_delay))
-- Write name values to list and clear old values.
if not minetest.check_player_privs(sender, {tp_admin = true}) then
tphr_list[receiver] = sender
-- Teleport timeout delay
minetest.after(timeout_delay, function(name)
@ -209,7 +206,6 @@ function tphr_send(sender, receiver)
end
end, receiver)
end
end
function tpc_send(player, coordinates)