From 4c394541199602bdf90591ac0ded6e303a4a7156 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Wed, 28 Apr 2021 21:26:02 -0500 Subject: [PATCH] Add paycheck stuff --- scripts/server/economy.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/scripts/server/economy.js b/scripts/server/economy.js index 07d0801b..67069306 100644 --- a/scripts/server/economy.js +++ b/scripts/server/economy.js @@ -25,4 +25,40 @@ function applyServerInflationMultiplier(value) { return toInteger(Math.round(value*getServerConfig().inflationMultiplier)) } +// =========================================================================== + +function playerPayDay(client) { + let wealth = calculateWealth(client); + let taxAmount = calculateTax(wealth); + let grossIncome = getPlayerData(client).payDayAmount; + + // Public Beta Bonus + taxAmount = 0; + grossIncome = grossIncome*2; + grossIncome = grossIncome + 2000; + + let netIncome = grossIncome-taxAmount; + + messagePlayerAlert(client, "== Payday! ============================="); + messagePlayerInfo(client, `Your paycheck: [#AAAAAA]$${grossIncome}`); + messagePlayerInfo(client, `Taxes: [#AAAAAA]$${taxAmount}`); + messagePlayerInfo(client, `You receive: [#AAAAAA]$${netIncome}`); + + givePlayerCash(client, netIncome); +} + +// =========================================================================== + +function calculateWealth(client) { + // To-do + return 0; +} + +// =========================================================================== + +function calculateTax(client) { + // To-do + return 0; +} + // =========================================================================== \ No newline at end of file