Added sounds when teleporting (both for when is allowed and for when is not)

master
Zughy 2020-07-20 21:07:23 +02:00
parent a5d66f637b
commit 7373da8d93
5 changed files with 17 additions and 11 deletions

View File

@ -1,4 +1,4 @@
# version 1.1.0
# version 1.2.0-dev
# author(s): Zughy
# reviewer(s):
# textdomain: magic_compass
@ -7,6 +7,5 @@
Magic Compass=Bussola Magica
# player_manager.lua
This location is not available for you at the moment!=Non ti è consentito l'accesso a questo luogo ora!
You can't reteleport to this location so quickly! (seconds remaining: @1)=Non puoi ritelerasportarti in questo luogo così velocemente! (secondi rimanenti: @1)
Wooosh!=Wooosh!
[!] This location is not available for you at the moment!=[!] Non ti è consentito l'accesso a questo luogo ora!
[!] You can't reteleport to this location so quickly! (seconds remaining: @1)=[!] Non puoi ritelerasportarti in questo luogo così velocemente! (secondi rimanenti: @1)

View File

@ -1,4 +1,4 @@
# version 1.1.0
# version 1.2.0-dev
# author(s):
# reviewer(s):
# textdomain: magic_compass
@ -7,6 +7,5 @@
Magic Compass=
# player_manager.lua
This location is not available for you at the moment!=
You can't reteleport to this location so quickly! (seconds remaining: @1)=
Wooosh!=
[!] This location is not available for you at the moment!=
[!] You can't reteleport to this location so quickly! (seconds remaining: @1)=

View File

@ -18,17 +18,25 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
-- se non ha i permessi, annullo
if item.privs and not minetest.check_player_privs(p_name, minetest.string_to_privs(item.privs, ", ")) then
minetest.chat_send_player(p_name, S("This location is not available for you at the moment!"))
minetest.chat_send_player(p_name, minetest.colorize("#e6482e", S("[!] This location is not available for you at the moment!")))
minetest.sound_play("magiccompass_teleport_deny", {
to_player = p_name
})
return end
-- se è in cooldown, annullo
if item.cooldown and on_cooldown[p_name] and on_cooldown[p_name][ID] then
minetest.chat_send_player(p_name, S("You can't reteleport to this location so quickly! (seconds remaining: @1)", on_cooldown[p_name][ID]))
minetest.chat_send_player(p_name, minetest.colorize("#e6482e", S("[!] You can't reteleport to this location so quickly! (seconds remaining: @1)", on_cooldown[p_name][ID])))
minetest.sound_play("magiccompass_teleport_deny", {
to_player = p_name
})
return end
-- teletrasporto
player:set_pos(minetest.string_to_pos(item.pos))
minetest.chat_send_player(p_name, S("Wooosh!"))
minetest.sound_play("magiccompass_teleport", {
to_player = p_name
})
-- eventuale cooldown
if item.cooldown then

Binary file not shown.

Binary file not shown.