From 3810b87430997c974d7ef671ca203d0247772e8b Mon Sep 17 00:00:00 2001 From: GNU Hacker Date: Fri, 17 Dec 2021 00:57:08 +0100 Subject: [PATCH] sonido y mensaje a irc al usar /pay --- commands.lua | 9 +++++++++ init.lua | 7 +++++++ mod.conf | 1 + 3 files changed, 17 insertions(+) diff --git a/commands.lua b/commands.lua index cb626e2..5e4a82e 100644 --- a/commands.lua +++ b/commands.lua @@ -42,8 +42,17 @@ core.register_chatcommand("pay", { if bankemeralds1 >= num then 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) ) + 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(player2, num) + core.sound_play("cash", { + to_player = playername2, + gain = 1.0, + fade = 0.0, + pitch = 1.0, + }) else core.chat_send_player(name, S("Not enough Emeralds in your account") ) end diff --git a/init.lua b/init.lua index 54b8781..4de9347 100644 --- a/init.lua +++ b/init.lua @@ -24,6 +24,13 @@ local modpath = core.get_modpath(core.get_current_modname()) 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) if income_enabled then diff --git a/mod.conf b/mod.conf index 084abc4..7112757 100644 --- a/mod.conf +++ b/mod.conf @@ -1,3 +1,4 @@ name = emeraldbank depends = mcl_core, mcl_sounds, mcl_inventory, mcl_formspec +optional_depends = irc description = Keep your Emeralds in a bank