From 931f38a5e64f198842ef38fbbcdda19500f1f445 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Tue, 4 Jan 2022 15:12:36 -0600 Subject: [PATCH] Add tax and wealth cmds --- scripts/server/economy.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/scripts/server/economy.js b/scripts/server/economy.js index 764b3f7c..801db35d 100644 --- a/scripts/server/economy.js +++ b/scripts/server/economy.js @@ -84,4 +84,31 @@ function forcePlayerPayDayCommand(command, params, client) { playerPayDay(targetClient); } +// =========================================================================== + +function taxInfoCommand(command, params, client) { + if(areParamsEmpty(params)) { + messagePlayerSyntax(client, getCommandSyntaxText(command)); + return false; + } + + let wealth = calculateWealth(client); + let tax = calculateIncomeTax(wealth); + + messagePlayerInfo(client, `Your tax on payday is: $${tax}. Use {ALTCOLOUR}/help tax {MAINCOLOUR}for more information.`); +} + +// =========================================================================== + +function wealthInfoCommand(command, params, client) { + if(areParamsEmpty(params)) { + messagePlayerSyntax(client, getCommandSyntaxText(command)); + return false; + } + + let wealth = calculateWealth(client); + + messagePlayerInfo(client, `Your wealth is: $${wealth}. Use {ALTCOLOUR}/help wealth {MAINCOLOUR}for more information.`); +} + // =========================================================================== \ No newline at end of file