sonido y mensaje a irc al usar /pay

This commit is contained in:
GNU Hacker 2021-12-17 00:57:08 +01:00
parent 4c634064e8
commit 3810b87430
3 changed files with 17 additions and 0 deletions

@ -42,8 +42,17 @@ core.register_chatcommand("pay", {
if bankemeralds1 >= num then if bankemeralds1 >= num then
core.chat_send_player(name, S("Pay Successfully! You have transferred @1 Emeralds." , num) ) core.chat_send_player(name, S("Pay Successfully! You have transferred @1 Emeralds." , num) )
core.chat_send_player(playername2, S("Pay Successfully! You've gotten @1 Emeralds.", num) ) core.chat_send_player(playername2, S("Pay Successfully! You've gotten @1 Emeralds.", num) )
if core.get_modpath("irc") then
irc.saysec( S("@1 has transferred @2 emeralds to @3", playername, num, playername2) )
end
emeraldbank.add_emeralds(player1, -num) emeraldbank.add_emeralds(player1, -num)
emeraldbank.add_emeralds(player2, num) emeraldbank.add_emeralds(player2, num)
core.sound_play("cash", {
to_player = playername2,
gain = 1.0,
fade = 0.0,
pitch = 1.0,
})
else else
core.chat_send_player(name, S("Not enough Emeralds in your account") ) core.chat_send_player(name, S("Not enough Emeralds in your account") )
end end

@ -24,6 +24,13 @@ local modpath = core.get_modpath(core.get_current_modname())
emeraldbank = {} emeraldbank = {}
-- compat with irc mod fork
if core.get_modpath("irc") then
if not irc.saysec then
irc.saysec = irc.say
end
end
local income_enabled = core.settings:get_bool("emeraldbank.income_enabled", true) local income_enabled = core.settings:get_bool("emeraldbank.income_enabled", true)
if income_enabled then if income_enabled then

@ -1,3 +1,4 @@
name = emeraldbank name = emeraldbank
depends = mcl_core, mcl_sounds, mcl_inventory, mcl_formspec depends = mcl_core, mcl_sounds, mcl_inventory, mcl_formspec
optional_depends = irc
description = Keep your Emeralds in a bank description = Keep your Emeralds in a bank