Add payday bonus multiplier

This commit is contained in:
Vortrex
2022-02-06 14:08:35 -06:00
parent 35047d6038
commit f81e9e5ec0

View File

@@ -30,8 +30,10 @@ function playerPayDay(client) {
let wealth = calculateWealth(client);
let grossIncome = getPlayerData(client).payDayAmount;
// Public Beta Bonus
// Passive income
grossIncome = grossIncome + getGlobalConfig().economy.passiveIncomePerPayDay;
// Payday bonus
grossIncome = grossIncome*getGlobalConfig().economy.grossIncomeMultiplier;
let incomeTaxAmount = calculateIncomeTax(wealth);
@@ -110,6 +112,26 @@ function forcePlayerPayDayCommand(command, params, client) {
// ===========================================================================
function setPayDayBonusMultiplier(command, params, client) {
if(areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
return false;
}
let newMultiplier = params;
if(isNaN(newMultiplier)) {
messagePlayerError(client, getLocaleString(client, "AmountNotNumber"));
return false;
}
getGlobalConfig().economy.grossIncomeMultiplier = newMultiplier;
messageAdminAction(`${client.name} set payday bonus to ${newMultiplier*100}%`);
}
// ===========================================================================
function taxInfoCommand(command, params, client) {
let wealth = calculateWealth(client);
let tax = calculateIncomeTax(wealth);