mirror of
https://github.com/minetest-mods/teleport-request.git
synced 2025-01-08 14:07:28 +01:00
Add "enable_immediate_teleport"
This commit is contained in:
parent
65cad92d7d
commit
07128f83c8
8
init.lua
8
init.lua
@ -125,7 +125,7 @@ function clear_tphr_list(name)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function tpr_send(sender, receiver)
|
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
|
if receiver == "" then
|
||||||
minetest.chat_send_player(sender, S("Usage: /tpr <Player name>"))
|
minetest.chat_send_player(sender, S("Usage: /tpr <Player name>"))
|
||||||
return
|
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))
|
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.
|
-- Write name values to list and clear old values.
|
||||||
if not minetest.check_player_privs(sender, {tp_admin = true}) then
|
|
||||||
tpr_list[receiver] = sender
|
tpr_list[receiver] = sender
|
||||||
-- Teleport timeout delay
|
-- Teleport timeout delay
|
||||||
minetest.after(timeout_delay, function(name)
|
minetest.after(timeout_delay, function(name)
|
||||||
@ -165,11 +164,10 @@ function tpr_send(sender, receiver)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
end, receiver)
|
end, receiver)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function tphr_send(sender, receiver)
|
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
|
if receiver == "" then
|
||||||
minetest.chat_send_player(sender, S("Usage: /tphr <Player name>"))
|
minetest.chat_send_player(sender, S("Usage: /tphr <Player name>"))
|
||||||
return
|
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))
|
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.
|
-- Write name values to list and clear old values.
|
||||||
if not minetest.check_player_privs(sender, {tp_admin = true}) then
|
|
||||||
tphr_list[receiver] = sender
|
tphr_list[receiver] = sender
|
||||||
-- Teleport timeout delay
|
-- Teleport timeout delay
|
||||||
minetest.after(timeout_delay, function(name)
|
minetest.after(timeout_delay, function(name)
|
||||||
@ -208,7 +205,6 @@ function tphr_send(sender, receiver)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
end, receiver)
|
end, receiver)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function tpc_send(player, coordinates)
|
function tpc_send(player, coordinates)
|
||||||
|
Loading…
Reference in New Issue
Block a user