mirror of
https://github.com/minetest-mods/teleport-request.git
synced 2025-01-24 05:31:25 +01:00
Reformatted/indented source
This commit is contained in:
parent
42d4bc82e7
commit
2ae3d6932f
13
init.lua
13
init.lua
@ -19,8 +19,8 @@ local function tpr_send(name, param)
|
|||||||
sender = name
|
sender = name
|
||||||
receiver = param
|
receiver = param
|
||||||
value_carryover = param
|
value_carryover = param
|
||||||
--Check for empty parameter
|
|
||||||
|
|
||||||
|
--Check for empty parameter
|
||||||
if receiver == "" then
|
if receiver == "" then
|
||||||
minetest.chat_send_player(sender, "Usage: /tpr <Player name>")
|
minetest.chat_send_player(sender, "Usage: /tpr <Player name>")
|
||||||
return
|
return
|
||||||
@ -77,7 +77,6 @@ function reset_request(name)
|
|||||||
|
|
||||||
if tpr_list[value_carryover] ~= nil then
|
if tpr_list[value_carryover] ~= nil then
|
||||||
tpr_list[value_carryover] = nil
|
tpr_list[value_carryover] = nil
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@ -88,23 +87,20 @@ function reset_request2(name)
|
|||||||
|
|
||||||
if tphr_list[value_carryover2] ~= nil then
|
if tphr_list[value_carryover2] ~= nil then
|
||||||
tphr_list[value_carryover2] = nil
|
tphr_list[value_carryover2] = nil
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function tpr_deny(name)
|
function tpr_deny(name)
|
||||||
sender = tpr_list[value_carryover]
|
sender = tpr_list[value_carryover]
|
||||||
if tpr_list[value_carryover] ~= nil then
|
if tpr_list[value_carryover] ~= nil then
|
||||||
tpr_list[value_carryover] = nil
|
tpr_list[value_carryover] = nil
|
||||||
minetest.chat_send_player(sender, 'Teleport request denied :C')
|
minetest.chat_send_player(sender, 'Teleport request denied :C')
|
||||||
|
|
||||||
end
|
end
|
||||||
sender2 = tphr_list[value_carryover2]
|
sender2 = tphr_list[value_carryover2]
|
||||||
if tphr_list[value_carryover2] ~= nil then
|
if tphr_list[value_carryover2] ~= nil then
|
||||||
tphr_list[value_carryover2] = nil
|
tphr_list[value_carryover2] = nil
|
||||||
minetest.chat_send_player(sender2, 'Teleport request denied :C')
|
minetest.chat_send_player(sender2, 'Teleport request denied :C')
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
--Teleport Accept Systems
|
--Teleport Accept Systems
|
||||||
@ -122,7 +118,6 @@ local function tpr_accept(name, param)
|
|||||||
|
|
||||||
if tpr_list[name] == nil and tphr_list[name] == nil then
|
if tpr_list[name] == nil and tphr_list[name] == nil then
|
||||||
minetest.chat_send_player(name, "Usage: /tpy allows you to accept teleport requests sent to you by other players")
|
minetest.chat_send_player(name, "Usage: /tpy allows you to accept teleport requests sent to you by other players")
|
||||||
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -168,8 +163,8 @@ local function tpr_accept(name, param)
|
|||||||
requester:setpos(p)
|
requester:setpos(p)
|
||||||
|
|
||||||
-- Set name values to nil to prevent re-teleporting on the same request.
|
-- Set name values to nil to prevent re-teleporting on the same request.
|
||||||
|
|
||||||
tpr_list[name] = nil
|
tpr_list[name] = nil
|
||||||
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user