Locale strings + weekend detect for double bonus
This commit is contained in:
@@ -36,6 +36,11 @@ function playerPayDay(client) {
|
|||||||
// Payday bonus
|
// Payday bonus
|
||||||
grossIncome = grossIncome*getGlobalConfig().economy.grossIncomeMultiplier;
|
grossIncome = grossIncome*getGlobalConfig().economy.grossIncomeMultiplier;
|
||||||
|
|
||||||
|
// Double bonus
|
||||||
|
if(isDoubleBonusActive()) {
|
||||||
|
grossIncome = grossIncome*2;
|
||||||
|
}
|
||||||
|
|
||||||
let incomeTaxAmount = calculateIncomeTax(wealth);
|
let incomeTaxAmount = calculateIncomeTax(wealth);
|
||||||
|
|
||||||
let netIncome = grossIncome-incomeTaxAmount;
|
let netIncome = grossIncome-incomeTaxAmount;
|
||||||
@@ -49,11 +54,11 @@ function playerPayDay(client) {
|
|||||||
let canPayNow = totalCash+netIncome;
|
let canPayNow = totalCash+netIncome;
|
||||||
if(incomeTaxAmount <= canPayNow) {
|
if(incomeTaxAmount <= canPayNow) {
|
||||||
takePlayerCash(client, canPayNow);
|
takePlayerCash(client, canPayNow);
|
||||||
messagePlayerInfo(client, `You covered the remaining taxes with {ALTCOLOUR}$${canPayNow} {MAINCOLOUR}in cash.`);
|
messagePlayerInfo(client, `{orange}${getLocaleString(client, "RemainingTaxPaidInCash", `{ALTCOLOUR}${canPayNow}{MAINCOLOUR}`)}`);
|
||||||
messagePlayerAlert(client, `{orange}You lost money since your taxes are more than your paycheck!`);
|
messagePlayerAlert(client, `{orange}${getLocaleString(client, "LostMoneyFromTaxes")}`);
|
||||||
messagePlayerAlert(client, `{orange}If you don't have enough cash to cover taxes on next paycheck, you will lose stuff!`);
|
messagePlayerAlert(client, `{orange}${getLocaleString(client, "NextPaycheckRepossessionWarning")}`);
|
||||||
} else {
|
} else {
|
||||||
messagePlayerInfo(client, `{orange}You don't have enough cash to pay your taxes!`);
|
messagePlayerInfo(client, `{orange}${getLocaleString(client, "NotEnoughCashForTax")}`);
|
||||||
takePlayerCash(client, canPayNow);
|
takePlayerCash(client, canPayNow);
|
||||||
|
|
||||||
let vehicleCount = getAllVehiclesOwnedByPlayer(client).length;
|
let vehicleCount = getAllVehiclesOwnedByPlayer(client).length;
|
||||||
@@ -65,7 +70,7 @@ function playerPayDay(client) {
|
|||||||
let newVehicleCount = getAllVehiclesOwnedByPlayer(client).length;
|
let newVehicleCount = getAllVehiclesOwnedByPlayer(client).length;
|
||||||
let newHouseCount = getAllHousesOwnedByPlayer(client).length;
|
let newHouseCount = getAllHousesOwnedByPlayer(client).length;
|
||||||
let newBusinessCount = getAllBusinessesOwnedByPlayer(client).length;
|
let newBusinessCount = getAllBusinessesOwnedByPlayer(client).length;
|
||||||
messagePlayerInfo(client, `{orange}You lost ${newVehicleCount-vehicleCount} vehicles, ${newHouseCount-houseCount} houses, and ${newBusinessCount-businessCount} businesses to cover the remaining tax.`);
|
messagePlayerInfo(client, `{orange}${getLocaleString(client, "AssetsRepossessedForTaxes", newVehicleCount-vehicleCount, newHouseCount-houseCount, newBusinessCount-businessCount)}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,6 +162,8 @@ function attemptRepossession(client, totalToPay) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
function repossessFirstAsset(client) {
|
function repossessFirstAsset(client) {
|
||||||
let vehicles = getAllVehiclesOwnedByPlayer(client);
|
let vehicles = getAllVehiclesOwnedByPlayer(client);
|
||||||
if(vehicles.length > 0) {
|
if(vehicles.length > 0) {
|
||||||
@@ -194,3 +201,15 @@ function getAllBusinessesOwnedByPlayer(client) {
|
|||||||
function getAllHousesOwnedByPlayer(client) {
|
function getAllHousesOwnedByPlayer(client) {
|
||||||
return getServerData().houses.filter((h) => h.ownerType == VRR_HOUSEOWNER_PLAYER && h.ownerId == getPlayerCurrentSubAccount(client).databaseId);
|
return getServerData().houses.filter((h) => h.ownerType == VRR_HOUSEOWNER_PLAYER && h.ownerId == getPlayerCurrentSubAccount(client).databaseId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function isDoubleBonusActive() {
|
||||||
|
if(isWeekend()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
Reference in New Issue
Block a user