diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecobits/commands/CommandPay.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecobits/commands/CommandPay.kt index 3b3de7f..cf105f7 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecobits/commands/CommandPay.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecobits/commands/CommandPay.kt @@ -88,6 +88,17 @@ class CommandPay( recipient.adjustBalance(currency, amount.toBigDecimal()) player.adjustBalance(currency, -amount.toBigDecimal()) + // Send a message to recipient if connected + if (recipient.isOnline) { + (recipient.player as Player).sendMessage( + plugin.langYml.getMessage("received-money", StringUtils.FormatOption.WITHOUT_PLACEHOLDERS) + .replace("%player%", player.savedDisplayName) + .replace("%amount%", amount.toNiceString()) + .replace("%currency%", currency.name) + ) + } + + player.sendMessage( plugin.langYml.getMessage("paid-player", StringUtils.FormatOption.WITHOUT_PLACEHOLDERS) .replace("%player%", recipient.savedDisplayName) diff --git a/eco-core/core-plugin/src/main/resources/lang.yml b/eco-core/core-plugin/src/main/resources/lang.yml index 3646a01..659a841 100644 --- a/eco-core/core-plugin/src/main/resources/lang.yml +++ b/eco-core/core-plugin/src/main/resources/lang.yml @@ -20,6 +20,7 @@ messages: cannot-afford: "&cYou can't afford to do this!" paid-player: "&fYou paid %player%&r &a%amount%&r &f%currency%&f!" too-much: "&fYou can't pay %player%&r this many &f%currency%&f as they already have too many!" + received-money: "&fYou received &a%amount% &f%currency% from %player%." top: name-empty: "&cEmpty" amount-empty: "&cEmpty"