mirror of
https://github.com/minetest-mods/teleport-request.git
synced 2024-11-19 22:03:55 +01:00
Add support for gamehub (UNTESTED)
By @shivajiva101.
This commit is contained in:
parent
50619558ce
commit
723a0ad42d
@ -68,6 +68,7 @@ However, optional dependencies are:
|
|||||||
- [intllib](https://github.com/minetest-mods/intllib)
|
- [intllib](https://github.com/minetest-mods/intllib)
|
||||||
- [beerchat](https://github.com/pandorabox-io/beerchat)
|
- [beerchat](https://github.com/pandorabox-io/beerchat)
|
||||||
- [chat2](https://github.com/minetest-mods/chat2)
|
- [chat2](https://github.com/minetest-mods/chat2)
|
||||||
|
- [gamehub](https://github.com/shivajiva101/minetest-gamehub)
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
This mod requires MT/MTG 5.0.0+ to run.
|
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
|
end
|
||||||
return
|
return
|
||||||
end
|
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
|
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(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)
|
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
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
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>"))
|
||||||
if minetest.get_modpath("chat2") then
|
if minetest.get_modpath("chat2") then
|
||||||
@ -258,10 +270,22 @@ function tp.tphr_send(sender, receiver)
|
|||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
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
|
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(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)
|
chat2.send_message(minetest.get_player_by_name(sender), S("Teleport request sent! It will timeout in @1 seconds", tp.timeout_delay), 0xFFFFFF)
|
||||||
end
|
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(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))
|
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.
|
-- 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"
|
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."
|
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
|
#: init.lua
|
||||||
msgid "You are teleporting to @1."
|
msgid "You are teleporting to @1."
|
||||||
msgstr "Te estas teletransportando a @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"
|
msgid "There is no player by that name. Keep in mind this is case sensitive, and the player must be online"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: init.lua
|
||||||
|
msgid "Teleport request denied, player is in the gamehub!"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: init.lua
|
#: init.lua
|
||||||
msgid "You are teleporting to @1."
|
msgid "You are teleporting to @1."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
2
mod.conf
2
mod.conf
@ -1,3 +1,3 @@
|
|||||||
name = tpr
|
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.
|
description = Allows players to send a request to other players to teleport to them, and do much more.
|
||||||
|
Loading…
Reference in New Issue
Block a user