Add support for gamehub (UNTESTED)

By @shivajiva101.
This commit is contained in:
Panquesito7 2019-11-22 13:50:10 -06:00
parent 50619558ce
commit 723a0ad42d
No known key found for this signature in database
GPG Key ID: 3C482B03FD220E68
5 changed files with 34 additions and 1 deletions

@ -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.

@ -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 ""

@ -1,3 +1,3 @@
name = tpr
optional_depends = areas, intllib, beerchat, chat2
optional_depends = areas, intllib, beerchat, chat2, gamehub
description = Allows players to send a request to other players to teleport to them, and do much more.