From 07128f83c84f2d6a4f28bbb2d84262c709aba432 Mon Sep 17 00:00:00 2001 From: Panquesito7 <51391473+Panquesito7@users.noreply.github.com> Date: Sat, 27 Jul 2019 19:41:04 -0500 Subject: [PATCH] Add "enable_immediate_teleport" --- init.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index c21c258..084eccf 100644 --- a/init.lua +++ b/init.lua @@ -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 ")) 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) @@ -165,11 +164,10 @@ function tpr_send(sender, receiver) return 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 ")) 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) @@ -208,7 +205,6 @@ function tphr_send(sender, receiver) return end end, receiver) - end end function tpc_send(player, coordinates)