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