Round all payday values

This commit is contained in:
Vortrex
2022-06-12 09:17:37 -05:00
parent cb4db94e97
commit e2340c7ea2

View File

@@ -31,19 +31,19 @@ function playerPayDay(client) {
let grossIncome = getPlayerData(client).payDayAmount;
// Passive income
grossIncome = grossIncome + getGlobalConfig().economy.passiveIncomePerPayDay;
grossIncome = Math.round(grossIncome + getGlobalConfig().economy.passiveIncomePerPayDay);
// Payday bonus
grossIncome = grossIncome*getGlobalConfig().economy.grossIncomeMultiplier;
grossIncome = Math.round(grossIncome * getGlobalConfig().economy.grossIncomeMultiplier);
// Double bonus
if (isDoubleBonusActive()) {
grossIncome = grossIncome*2;
grossIncome = Math.round(grossIncome * 2);
}
let incomeTaxAmount = Math.round(calculateIncomeTax(wealth));
let netIncome = grossIncome-incomeTaxAmount;
let netIncome = Math.round(grossIncome - incomeTaxAmount);
messagePlayerAlert(client, "== Payday! =============================");
messagePlayerInfo(client, `Paycheck: {ALTCOLOUR}$${grossIncome}`);
@@ -167,7 +167,7 @@ function attemptRepossession(client, totalToPay) {
function repossessFirstAsset(client) {
let vehicles = getAllVehiclesOwnedByPlayer(client);
if (vehicles.length > 0) {
deleteVehicle(vehicles[0])
deleteVehicle(vehicles[0]);
return getGlobalConfig().economy.upKeepCosts.upKeepPerVehicle;
}