mirror of
https://github.com/minetest-mods/teleport-request.git
synced 2025-03-14 13:22:28 +01:00
Add support for gamehub (UNTESTED)
By @shivajiva101.
This commit is contained in:
@ -68,6 +68,7 @@ However, optional dependencies are:
|
||||
- [intllib](https://github.com/minetest-mods/intllib)
|
||||
- [beerchat](https://github.com/pandorabox-io/beerchat)
|
||||
- [chat2](https://github.com/minetest-mods/chat2)
|
||||
- [gamehub](https://github.com/shivajiva101/minetest-gamehub)
|
||||
|
||||
## Requirements
|
||||
This mod requires MT/MTG 5.0.0+ to run.
|
||||
|
24
init.lua
24
init.lua
@ -186,6 +186,17 @@ function tp.tpr_send(sender, receiver)
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
if minetest.get_modpath("gamehub") then -- Compatibility with gamehub (UNTESTED)
|
||||
if gamehub.players[receiver] then
|
||||
minetest.chat_send_player(sender, S("Teleport request denied, player is in the gamehub!"))
|
||||
if minetest.get_modpath("chat2") then
|
||||
chat2.send_message(minetest.get_player_by_name(sender), S("Teleport request denied, player is in the gamehub!"), 0xFFFFFF)
|
||||
end
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
if minetest.get_modpath("chat2") then
|
||||
chat2.send_message(minetest.get_player_by_name(receiver), S("@1 is requesting to teleport to you. /tpy to accept", sender), 0xFFFFFF)
|
||||
chat2.send_message(minetest.get_player_by_name(sender), S("Teleport request sent! It will timeout in @1 seconds", tp.timeout_delay), 0xFFFFFF)
|
||||
@ -243,6 +254,7 @@ function tp.tphr_send(sender, receiver)
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
if receiver == "" then
|
||||
minetest.chat_send_player(sender, S("Usage: /tphr <Player name>"))
|
||||
if minetest.get_modpath("chat2") then
|
||||
@ -258,10 +270,22 @@ function tp.tphr_send(sender, receiver)
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
if minetest.get_modpath("gamehub") then -- Compatibility with gamehub (UNTESTED)
|
||||
if gamehub.players[receiver] then
|
||||
minetest.chat_send_player(sender, S("Teleport request denied, player is in the gamehub!"))
|
||||
if minetest.get_modpath("chat2") then
|
||||
chat2.send_message(minetest.get_player_by_name(sender), S("Teleport request denied, player is in the gamehub!"), 0xFFFFFF)
|
||||
end
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
if minetest.get_modpath("chat2") then
|
||||
chat2.send_message(minetest.get_player_by_name(receiver), S("@1 is requesting that you teleport to them. /tpy to accept; /tpn to deny", sender), 0xFFFFFF)
|
||||
chat2.send_message(minetest.get_player_by_name(sender), S("Teleport request sent! It will timeout in @1 seconds", tp.timeout_delay), 0xFFFFFF)
|
||||
end
|
||||
|
||||
minetest.chat_send_player(receiver, S("@1 is requesting that you teleport to them. /tpy to accept; /tpn to deny", sender))
|
||||
minetest.chat_send_player(sender, S("Teleport request sent! It will timeout in @1 seconds", tp.timeout_delay))
|
||||
-- Write name values to list and clear old values.
|
||||
|
@ -40,6 +40,10 @@ msgstr "Uso: /tpr <jugador>"
|
||||
msgid "There is no player by that name. Keep in mind this is case-sensitive, and the player must be online"
|
||||
msgstr "No hay jugador con ese nombre. Tenga en cuenta que esto es caso-sensitivo, y el jugador debe de estar én linea."
|
||||
|
||||
#: init.lua
|
||||
msgid "Teleport request denied, player is in the gamehub!"
|
||||
msgstr "Solicitud denegada, ¡el jugador esta en el centro de juegos!"
|
||||
|
||||
#: init.lua
|
||||
msgid "You are teleporting to @1."
|
||||
msgstr "Te estas teletransportando a @1."
|
||||
|
@ -40,6 +40,10 @@ msgstr ""
|
||||
msgid "There is no player by that name. Keep in mind this is case sensitive, and the player must be online"
|
||||
msgstr ""
|
||||
|
||||
#: init.lua
|
||||
msgid "Teleport request denied, player is in the gamehub!"
|
||||
msgstr ""
|
||||
|
||||
#: init.lua
|
||||
msgid "You are teleporting to @1."
|
||||
msgstr ""
|
||||
|
Reference in New Issue
Block a user