Use new currency string

This commit is contained in:
Vortrex
2022-08-23 14:28:38 -05:00
parent 9e44f4d2fa
commit cdebb12226
14 changed files with 97 additions and 48 deletions

View File

@@ -4,6 +4,7 @@
"applyUpkeep": true, "applyUpkeep": true,
"grossIncomeMultiplier": 1.0, "grossIncomeMultiplier": 1.0,
"incomeTaxRate": 0.7, "incomeTaxRate": 0.7,
"currencyString": "${AMOUNT}",
"upKeepCosts": { "upKeepCosts": {
"upKeepPerVehicle": 250, "upKeepPerVehicle": 250,
"upKeepPerHouse": 350, "upKeepPerHouse": 350,

27
scripts/client/economy.js Normal file
View File

@@ -0,0 +1,27 @@
// ===========================================================================
// Asshat Gaming Roleplay
// https://github.com/VortrexFTW/agrp_main
// (c) 2022 Asshat Gaming
// ===========================================================================
// FILE: economy.js
// DESC: Provides economy functions
// TYPE: Client (JavaScript)
// ===========================================================================
let currencyString = "{AMOUNT}";
// ===========================================================================
function getCurrencyString(amount) {
let tempString = currencyString;
tempString = tempString.replace("{AMOUNT}", toString(makeLargeNumberReadable(amount)));
return tempString;
}
// ===========================================================================
function receiveCurrencyStringFromServer(newCurrencyString) {
currencyString = newCurrencyString;
}
// ===========================================================================

View File

@@ -162,7 +162,7 @@ function showCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, ski
setChatWindowEnabled(false); setChatWindowEnabled(false);
mexui.setInput(true); mexui.setInput(true);
characterSelect.nameText.text = `${firstName} ${lastName}`; characterSelect.nameText.text = `${firstName} ${lastName}`;
characterSelect.cashText.text = `Money: $${cash}`; characterSelect.cashText.text = `Money: ${getCurrencyString(cash)}`;
characterSelect.clanText.text = `Clan: ${clan}`; characterSelect.clanText.text = `Clan: ${clan}`;
characterSelect.lastPlayedText.text = `Last Played: ${lastPlayed}`; characterSelect.lastPlayedText.text = `Last Played: ${lastPlayed}`;
characterSelect.skinImage = characterSelect.window.image(310, 32, 100, 90, "files/images/skins/none.png"); characterSelect.skinImage = characterSelect.window.image(310, 32, 100, 90, "files/images/skins/none.png");
@@ -211,7 +211,7 @@ function switchCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, s
setChatWindowEnabled(false); setChatWindowEnabled(false);
characterSelect.window.shown = false; characterSelect.window.shown = false;
characterSelect.nameText.text = `${firstName} ${lastName}`; characterSelect.nameText.text = `${firstName} ${lastName}`;
characterSelect.cashText.text = `Money: $${cash}`; characterSelect.cashText.text = `Money: ${getCurrencyString(cash)}`;
characterSelect.clanText.text = `Clan: ${clan}`; characterSelect.clanText.text = `Clan: ${clan}`;
characterSelect.lastPlayedText.text = `Last Played: ${lastPlayed}`; characterSelect.lastPlayedText.text = `Last Played: ${lastPlayed}`;

View File

@@ -70,6 +70,7 @@ function addAllNetworkHandlers() {
addNetworkEventHandler("agrp.veh.engine", setVehicleEngine); addNetworkEventHandler("agrp.veh.engine", setVehicleEngine);
addNetworkEventHandler("agrp.veh.repair", repairVehicle); addNetworkEventHandler("agrp.veh.repair", repairVehicle);
addNetworkEventHandler("agrp.cruiseControl", toggleVehicleCruiseControl); addNetworkEventHandler("agrp.cruiseControl", toggleVehicleCruiseControl);
addNetworkEventHandler("agrp.passenger", enterVehicleAsPassenger);
// Radio // Radio
addNetworkEventHandler("agrp.radioStream", playStreamingRadio); addNetworkEventHandler("agrp.radioStream", playStreamingRadio);
@@ -109,6 +110,11 @@ function addAllNetworkHandlers() {
addNetworkEventHandler("agrp.showLocaleChooser", showLocaleChooserGUI); addNetworkEventHandler("agrp.showLocaleChooser", showLocaleChooserGUI);
addNetworkEventHandler("agrp.guiColour", setGUIColours); addNetworkEventHandler("agrp.guiColour", setGUIColours);
// 2D Rendering
addNetworkEventHandler("agrp.set2DRendering", set2DRendering);
addNetworkEventHandler("agrp.logo", setServerLogoRenderState);
addNetworkEventHandler("agrp.showItemActionDelay", showItemActionDelay);
// Business // Business
addNetworkEventHandler("agrp.business", receiveBusinessFromServer); addNetworkEventHandler("agrp.business", receiveBusinessFromServer);
@@ -122,13 +128,20 @@ function addAllNetworkHandlers() {
addNetworkEventHandler("agrp.locale", setLocale); addNetworkEventHandler("agrp.locale", setLocale);
addNetworkEventHandler("agrp.localeChooser", toggleLocaleChooserGUI); addNetworkEventHandler("agrp.localeChooser", toggleLocaleChooserGUI);
// Animation
addNetworkEventHandler("agrp.anim", makePedPlayAnimation);
addNetworkEventHandler("agrp.stopAnim", makePedStopAnimation);
addNetworkEventHandler("agrp.forceAnim", forcePedAnimation);
// Nametags
addNetworkEventHandler("agrp.nametag", updatePlayerNameTag);
addNetworkEventHandler("agrp.nametagDistance", setNameTagDistance);
// Misc // Misc
addNetworkEventHandler("agrp.mouseCursor", toggleMouseCursor); addNetworkEventHandler("agrp.mouseCursor", toggleMouseCursor);
addNetworkEventHandler("agrp.mouseCamera", toggleMouseCamera); addNetworkEventHandler("agrp.mouseCamera", toggleMouseCamera);
addNetworkEventHandler("agrp.clearPeds", clearLocalPlayerOwnedPeds); addNetworkEventHandler("agrp.clearPeds", clearLocalPlayerOwnedPeds);
addNetworkEventHandler("agrp.clearPickups", clearLocalPlayerOwnedPickups); addNetworkEventHandler("agrp.clearPickups", clearLocalPlayerOwnedPickups);
addNetworkEventHandler("agrp.passenger", enterVehicleAsPassenger);
addNetworkEventHandler("agrp.logo", setServerLogoRenderState);
addNetworkEventHandler("agrp.ambience", setCityAmbienceState); addNetworkEventHandler("agrp.ambience", setCityAmbienceState);
addNetworkEventHandler("agrp.runCode", runClientCode); addNetworkEventHandler("agrp.runCode", runClientCode);
addNetworkEventHandler("agrp.minuteDuration", setMinuteDuration); addNetworkEventHandler("agrp.minuteDuration", setMinuteDuration);
@@ -136,17 +149,10 @@ function addAllNetworkHandlers() {
addNetworkEventHandler("agrp.enterPropertyKey", setEnterPropertyKey); addNetworkEventHandler("agrp.enterPropertyKey", setEnterPropertyKey);
addNetworkEventHandler("agrp.skinSelect", toggleSkinSelect); addNetworkEventHandler("agrp.skinSelect", toggleSkinSelect);
addNetworkEventHandler("agrp.hotbar", updatePlayerHotBar); addNetworkEventHandler("agrp.hotbar", updatePlayerHotBar);
addNetworkEventHandler("agrp.showItemActionDelay", showItemActionDelay);
addNetworkEventHandler("agrp.set2DRendering", set2DRendering);
addNetworkEventHandler("agrp.mouseCameraForce", setMouseCameraState); addNetworkEventHandler("agrp.mouseCameraForce", setMouseCameraState);
addNetworkEventHandler("agrp.logLevel", setLogLevel); addNetworkEventHandler("agrp.logLevel", setLogLevel);
addNetworkEventHandler("agrp.hideAllGUI", hideAllGUI); addNetworkEventHandler("agrp.hideAllGUI", hideAllGUI);
addNetworkEventHandler("agrp.nametag", updatePlayerNameTag);
addNetworkEventHandler("agrp.nametagDistance", setNameTagDistance);
addNetworkEventHandler("agrp.ping", updatePlayerPing); addNetworkEventHandler("agrp.ping", updatePlayerPing);
addNetworkEventHandler("agrp.anim", makePedPlayAnimation);
addNetworkEventHandler("agrp.stopAnim", makePedStopAnimation);
addNetworkEventHandler("agrp.forceAnim", forcePedAnimation);
addNetworkEventHandler("agrp.clientInfo", serverRequestedClientInfo); addNetworkEventHandler("agrp.clientInfo", serverRequestedClientInfo);
addNetworkEventHandler("agrp.interiorLights", updateInteriorLightsState); addNetworkEventHandler("agrp.interiorLights", updateInteriorLightsState);
addNetworkEventHandler("agrp.cutsceneInterior", setCutsceneInterior); addNetworkEventHandler("agrp.cutsceneInterior", setCutsceneInterior);
@@ -156,6 +162,7 @@ function addAllNetworkHandlers() {
addNetworkEventHandler("agrp.vehBuyState", setVehiclePurchaseState); addNetworkEventHandler("agrp.vehBuyState", setVehiclePurchaseState);
addNetworkEventHandler("agrp.holdObject", makePedHoldObject); addNetworkEventHandler("agrp.holdObject", makePedHoldObject);
addNetworkEventHandler("agrp.profanityFilter", setProfanityFilterState); addNetworkEventHandler("agrp.profanityFilter", setProfanityFilterState);
addNetworkEventHandler("agrp.currencyString", receiveCurrencyStringFromServer);
} }
// =========================================================================== // ===========================================================================

View File

@@ -847,7 +847,7 @@ function setBusinessEntranceFeeCommand(command, params, client) {
getBusinessData(businessId).entranceFee = entranceFee; getBusinessData(businessId).entranceFee = entranceFee;
getBusinessData(businessId).needsSaved = true; getBusinessData(businessId).needsSaved = true;
messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} entrance fee to [#AAAAAAA]$${entranceFee}`); messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} entrance fee to {ALTCOLOUR}${getCurrencyString(entranceFee)}`);
} }
// =========================================================================== // ===========================================================================
@@ -940,14 +940,14 @@ function getBusinessInfoCommand(command, params, client) {
[`ID`, `${businessData.index}/${businessData.databaseId}`], [`ID`, `${businessData.index}/${businessData.databaseId}`],
[`Owner`, `${ownerName} (${getBusinessOwnerTypeText(businessData.ownerType)})`], [`Owner`, `${ownerName} (${getBusinessOwnerTypeText(businessData.ownerType)})`],
[`Locked`, `${getLockedUnlockedFromBool(businessData.locked)}`], [`Locked`, `${getLockedUnlockedFromBool(businessData.locked)}`],
[`BuyPrice`, `$${businessData.buyPrice}`], [`BuyPrice`, `${getCurrencyString(businessData.buyPrice)}`],
//[`RentPrice`, `${businessData.rentPrice}`], //[`RentPrice`, `${businessData.rentPrice}`],
[`HasInterior`, `${getYesNoFromBool(businessData.hasInterior)}`], [`HasInterior`, `${getYesNoFromBool(businessData.hasInterior)}`],
[`CustomInterior`, `${getYesNoFromBool(businessData.customInterior)}`], [`CustomInterior`, `${getYesNoFromBool(businessData.customInterior)}`],
[`HasBuyableItems`, `${getYesNoFromBool(doesBusinessHaveAnyItemsToBuy(businessId))}`], [`HasBuyableItems`, `${getYesNoFromBool(doesBusinessHaveAnyItemsToBuy(businessId))}`],
[`EntranceFee`, `$${businessData.entranceFee}`], [`EntranceFee`, `${getCurrencyString(businessData.entranceFee)}`],
[`InteriorLights`, `${getOnOffFromBool(businessData.interiorLights)}`], [`InteriorLights`, `${getOnOffFromBool(businessData.interiorLights)}`],
[`Balance`, `$${businessData.till}`], [`Balance`, `${getCurrencyString(businessData.till)}`],
[`RadioStation`, `${businessData.streamingRadioStation}`], [`RadioStation`, `${businessData.streamingRadioStation}`],
[`LabelHelpType`, `${businessData.labelHelpType}`], [`LabelHelpType`, `${businessData.labelHelpType}`],
]; ];
@@ -1409,7 +1409,7 @@ function withdrawFromBusinessCommand(command, params, client) {
updatePlayerCash(client); updatePlayerCash(client);
getBusinessData(businessId).needsSaved = true; getBusinessData(businessId).needsSaved = true;
messagePlayerSuccess(client, `You withdrew $${amount} from business {businessBlue}${getBusinessData(businessId).name} till`); messagePlayerSuccess(client, `You withdrew ${getCurrencyString(amount)} from business {businessBlue}${getBusinessData(businessId).name} till`);
} }
// =========================================================================== // ===========================================================================
@@ -1451,7 +1451,7 @@ function setBusinessBuyPriceCommand(command, params, client) {
setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.price", getBusinessData(businessId).buyPrice, true); setEntityData(getBusinessData(businessId).entrancePickup, "agrp.label.price", getBusinessData(businessId).buyPrice, true);
getBusinessData(businessId).needsSaved = true; getBusinessData(businessId).needsSaved = true;
messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name}'s {MAINCOLOUR}for-sale price to {ALTCOLOUR}$${makeLargeNumberReadable(amount)}`); messagePlayerSuccess(client, `{MAINCOLOUR}You set business {businessBlue}${getBusinessData(businessId).name}'s{MAINCOLOUR} for-sale price to {ALTCOLOUR}${getCurrencyString(amount)}`);
} }
// =========================================================================== // ===========================================================================
@@ -1486,7 +1486,7 @@ function depositIntoBusinessCommand(command, params, client) {
//} //}
if (getPlayerCurrentSubAccount(client).cash < amount) { if (getPlayerCurrentSubAccount(client).cash < amount) {
messagePlayerError(client, `You don't have that much money! You only have $${getPlayerCurrentSubAccount(client).cash}`); messagePlayerError(client, `You don't have that much money! You only have ${getCurrencyString(getPlayerCurrentSubAccount(client).cash)}`);
return false; return false;
} }
@@ -1495,7 +1495,7 @@ function depositIntoBusinessCommand(command, params, client) {
updatePlayerCash(client); updatePlayerCash(client);
getBusinessData(businessId).needsSaved = true; getBusinessData(businessId).needsSaved = true;
messagePlayerSuccess(client, `You deposited $${amount} into business {businessBlue}${getBusinessData(businessId).name} {MAINCOLOUR}till`); messagePlayerSuccess(client, `You deposited ${getCurrencyString(amount)} into business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} till`);
} }
// =========================================================================== // ===========================================================================
@@ -1556,7 +1556,7 @@ function orderItemForBusinessCommand(command, params, client) {
getPlayerData(client).businessOrderCost = orderTotalCost; getPlayerData(client).businessOrderCost = orderTotalCost;
getBusinessData(businessId).needsSaved = true; getBusinessData(businessId).needsSaved = true;
showPlayerPrompt(client, `Ordering ${amount} ${getPluralForm(getItemTypeData(itemType).name)} (${getItemValueDisplay(itemType, value)}) at $${makeLargeNumberReadable(pricePerItem)} each will cost a total of $${makeLargeNumberReadable(orderTotalCost)}`, "Business Order Cost"); showPlayerPrompt(client, `Ordering ${amount} ${getPluralForm(getItemTypeData(itemType).name)} (${getItemValueDisplay(itemType, value)}) at ${getCurrencyString(pricePerItem)} each will cost a total of ${getCurrencyString(orderTotalCost)}`, "Business Order Cost");
getPlayerData(client).promptType = AGRP_PROMPT_BIZORDER; getPlayerData(client).promptType = AGRP_PROMPT_BIZORDER;
} }
@@ -1574,13 +1574,13 @@ function orderItemForBusinessCommand(command, params, client) {
function orderItemForBusiness(businessId, itemType, amount) { function orderItemForBusiness(businessId, itemType, amount) {
if (getBusinessData(businessId).till < orderTotalCost) { if (getBusinessData(businessId).till < orderTotalCost) {
let neededAmount = orderTotalCost - getBusinessData(businessId).till; let neededAmount = orderTotalCost - getBusinessData(businessId).till;
//messagePlayerError(client, `The business doesn't have enough money (needs {ALTCOLOUR}$${neededAmount} {MAINCOLOUR}more)! Use {ALTCOLOUR}/bizdeposit {MAINCOLOUR}to add money to the business.`); //messagePlayerError(client, `The business doesn't have enough money (needs {ALTCOLOUR}${getCurrencyString(neededAmount)} {MAINCOLOUR}more)! Use {ALTCOLOUR}/bizdeposit {MAINCOLOUR}to add money to the business.`);
return false; return false;
} }
getBusinessData(businessId).till -= orderTotalCost; getBusinessData(businessId).till -= orderTotalCost;
addToBusinessInventory(businessId, itemType, amount); addToBusinessInventory(businessId, itemType, amount);
//messagePlayerSuccess(client, `You ordered ${amount} ${getPluralForm(getItemTypeData(itemType).name)} (${getItemValueDisplay(itemType, value)}) at $${getItemTypeData(itemType).orderPrice} each for business {businessBlue}${getBusinessData(businessId).name}`); //messagePlayerSuccess(client, `You ordered ${amount} ${getPluralForm(getItemTypeData(itemType).name)} (${getItemValueDisplay(itemType, value)}) at ${getCurrencyString(getItemTypeData(itemType).orderPrice)} each for business {businessBlue}${getBusinessData(businessId).name}`);
} }
// =========================================================================== // ===========================================================================
@@ -1611,7 +1611,7 @@ function viewBusinessTillAmountCommand(command, params, client) {
return false; return false;
} }
messagePlayerSuccess(client, `Business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} till has {ALTCOLOUR}$${getBusinessData(businessId).till}`); messagePlayerSuccess(client, `Business {businessBlue}${getBusinessData(businessId).name}{MAINCOLOUR} till has {ALTCOLOUR}${getCurrencyString(getBusinessData(businessId).till)}`);
} }
// =========================================================================== // ===========================================================================
@@ -2722,7 +2722,7 @@ function setBusinessItemSellPriceCommand(command, params, client) {
getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).buyPrice = newPrice; getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).buyPrice = newPrice;
messagePlayerSuccess(client, `You changed the price of the {ALTCOLOUR}${getItemTypeData(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex).name}'s {MAINCOLOUR}in slot {ALTCOLOUR}${itemSlot} {MAINCOLOUR}from $${makeLargeNumberReadable(oldPrice)} to $${makeLargeNumberReadable(newprice)}`); messagePlayerSuccess(client, `You changed the price of the {ALTCOLOUR}${getItemTypeData(getItemData(getBusinessData(businessId).floorItemCache[itemSlot - 1]).itemTypeIndex).name}'s {MAINCOLOUR}in slot {ALTCOLOUR}${itemSlot} {MAINCOLOUR}from ${getCurrencyString(oldPrice)} to ${getCurrencyString(newprice)}`);
} }
// =========================================================================== // ===========================================================================

View File

@@ -47,15 +47,15 @@ function playerPayDay(client) {
let netIncome = Math.round(grossIncome - incomeTaxAmount); let netIncome = Math.round(grossIncome - incomeTaxAmount);
messagePlayerAlert(client, "== Payday! ============================="); messagePlayerAlert(client, "== Payday! =============================");
messagePlayerInfo(client, `Paycheck: {ALTCOLOUR}$${grossIncome}`); messagePlayerInfo(client, `Paycheck: {ALTCOLOUR}${getCurrencyString(grossIncome)}`);
messagePlayerInfo(client, `Taxes: {ALTCOLOUR}$${incomeTaxAmount}`); messagePlayerInfo(client, `Taxes: {ALTCOLOUR}${getCurrencyString(incomeTaxAmount)}`);
messagePlayerInfo(client, `You receive: {ALTCOLOUR}$${netIncome}`); messagePlayerInfo(client, `You receive: {ALTCOLOUR}${getCurrencyString(netIncome)}`);
if (netIncome < incomeTaxAmount) { if (netIncome < incomeTaxAmount) {
let totalCash = getPlayerCash(client); let totalCash = getPlayerCash(client);
let canPayNow = totalCash + netIncome; let canPayNow = totalCash + netIncome;
if (incomeTaxAmount <= canPayNow) { if (incomeTaxAmount <= canPayNow) {
takePlayerCash(client, canPayNow); takePlayerCash(client, canPayNow);
messagePlayerInfo(client, `{orange}${getLocaleString(client, "RemainingTaxPaidInCash", `{ALTCOLOUR}${canPayNow}{MAINCOLOUR}`)}`); messagePlayerInfo(client, `{orange}${getLocaleString(client, "RemainingTaxPaidInCash", `{ALTCOLOUR}${getCurrencyString(canPayNow)}{MAINCOLOUR}`)}`);
messagePlayerAlert(client, `{orange}${getLocaleString(client, "LostMoneyFromTaxes")}`); messagePlayerAlert(client, `{orange}${getLocaleString(client, "LostMoneyFromTaxes")}`);
messagePlayerAlert(client, `{orange}${getLocaleString(client, "NextPaycheckRepossessionWarning")}`); messagePlayerAlert(client, `{orange}${getLocaleString(client, "NextPaycheckRepossessionWarning")}`);
} else { } else {
@@ -141,14 +141,14 @@ function setPayDayBonusMultiplier(command, params, client) {
function taxInfoCommand(command, params, client) { function taxInfoCommand(command, params, client) {
let wealth = calculateWealth(client); let wealth = calculateWealth(client);
let tax = calculateIncomeTax(wealth); let tax = calculateIncomeTax(wealth);
messagePlayerInfo(client, `Your tax on payday is: $${tax}. Use {ALTCOLOUR}/help tax {MAINCOLOUR}for more information.`); messagePlayerInfo(client, `Your tax on payday is: ${getCurrencyString(tax)}. Use {ALTCOLOUR}/help tax {MAINCOLOUR}for more information.`);
} }
// =========================================================================== // ===========================================================================
function wealthInfoCommand(command, params, client) { function wealthInfoCommand(command, params, client) {
let wealth = calculateWealth(client); let wealth = calculateWealth(client);
messagePlayerInfo(client, `Your wealth is: {ALTCOLOUR}$${wealth}{MAINCOLOUR}. Use {ALTCOLOUR}/help wealth {MAINCOLOUR}for more information.`); messagePlayerInfo(client, `Your wealth is: {ALTCOLOUR}${getCurrencyString(wealth)}{MAINCOLOUR}. Use {ALTCOLOUR}/help wealth {MAINCOLOUR}for more information.`);
} }
// =========================================================================== // ===========================================================================
@@ -214,3 +214,11 @@ function isDoubleBonusActive() {
} }
// =========================================================================== // ===========================================================================
function getCurrencyString(amount) {
let tempString = getEconomyConfig().currencyString
tempString = tempString.replace("{AMOUNT}", toString(makeLargeNumberReadable(amount)));
return tempString;
}
// ===========================================================================

View File

@@ -694,14 +694,14 @@ function onPedEnteredVehicle(event, ped, vehicle, seat) {
vehicle.engine = getVehicleData(vehicle).engine; vehicle.engine = getVehicleData(vehicle).engine;
if (getVehicleData(vehicle).buyPrice > 0) { if (getVehicleData(vehicle).buyPrice > 0) {
messagePlayerAlert(client, getLocaleString(client, "VehicleForSale", getVehicleName(vehicle), `{ALTCOLOUR}$${makeLargeNumberReadable(getVehicleData(vehicle).buyPrice)}{MAINCOLOUR}`, `{ALTCOLOUR}/vehbuy{MAINCOLOUR}`)); messagePlayerAlert(client, getLocaleString(client, "VehicleForSale", getVehicleName(vehicle), `{ALTCOLOUR}${getCurrencyString(getVehicleData(vehicle).buyPrice)}{MAINCOLOUR}`, `{ALTCOLOUR}/vehbuy{MAINCOLOUR}`));
resetVehiclePosition(vehicle); resetVehiclePosition(vehicle);
} else if (getVehicleData(vehicle).rentPrice > 0) { } else if (getVehicleData(vehicle).rentPrice > 0) {
if (getVehicleData(vehicle).rentedBy != client) { if (getVehicleData(vehicle).rentedBy != client) {
messagePlayerAlert(client, getLocaleString(client, "VehicleForRent", getVehicleName(vehicle), `{ALTCOLOUR}$${makeLargeNumberReadable(getVehicleData(vehicle).rentPrice)}{MAINCOLOUR}`, `{ALTCOLOUR}/vehrent{MAINCOLOUR}`)); messagePlayerAlert(client, getLocaleString(client, "VehicleForRent", getVehicleName(vehicle), `{ALTCOLOUR}${getCurrencyString(getVehicleData(vehicle).rentPrice)}{MAINCOLOUR}`, `{ALTCOLOUR}/vehrent{MAINCOLOUR}`));
resetVehiclePosition(vehicle); resetVehiclePosition(vehicle);
} else { } else {
messagePlayerAlert(client, getLocaleString(client, "CurrentlyRentingThisVehicle", `{vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR}`, `{ALTCOLOUR}$${makeLargeNumberReadable(getVehicleData(vehicle).rentPrice)}`, `{ALTCOLOUR}/stoprent{MAINCOLOUR}`)); messagePlayerAlert(client, getLocaleString(client, "CurrentlyRentingThisVehicle", `{vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR}`, `{ALTCOLOUR}${getCurrencyString(getVehicleData(vehicle).rentPrice)}`, `{ALTCOLOUR}/stoprent{MAINCOLOUR}`));
} }
} else { } else {
let ownerName = "Nobody"; let ownerName = "Nobody";

View File

@@ -1384,7 +1384,7 @@ function setHouseBuyPriceCommand(command, params, client) {
getHouseData(houseId).buyPrice = amount; getHouseData(houseId).buyPrice = amount;
getHouseData(houseId).needsSaved = true; getHouseData(houseId).needsSaved = true;
updateHousePickupLabelData(houseId); updateHousePickupLabelData(houseId);
messagePlayerSuccess(client, `{MAINCOLOUR}You set house {houseGreen}${getHouseData(houseId).description}'s{MAINCOLOUR} for-sale price to {ALTCOLOUR}$${makeLargeNumberReadable(amount)}`); messagePlayerSuccess(client, `{MAINCOLOUR}You set house {houseGreen}${getHouseData(houseId).description}'s{MAINCOLOUR} for-sale price to {ALTCOLOUR}${getCurrencyString(amount)}`);
} }
// =========================================================================== // ===========================================================================
@@ -1422,7 +1422,7 @@ function setHouseRentPriceCommand(command, params, client) {
getHouseData(houseId).rentPrice = amount; getHouseData(houseId).rentPrice = amount;
getHouseData(houseId).needsSaved = true; getHouseData(houseId).needsSaved = true;
updateHousePickupLabelData(houseId); updateHousePickupLabelData(houseId);
messagePlayerSuccess(client, `{MAINCOLOUR}You set house {houseGreen}${getHouseData(houseId).description}'s{MAINCOLOUR} rent price to {ALTCOLOUR}$${makeLargeNumberReadable(amount)}`); messagePlayerSuccess(client, `{MAINCOLOUR}You set house {houseGreen}${getHouseData(houseId).description}'s{MAINCOLOUR} rent price to {ALTCOLOUR}${getCurrencyString(amount)}`);
} }
// =========================================================================== // ===========================================================================

View File

@@ -887,7 +887,7 @@ function setItemTypeOrderPriceCommand(command, params, client) {
getItemTypeData(itemTypeIndex).orderPrice = orderPrice; getItemTypeData(itemTypeIndex).orderPrice = orderPrice;
getItemTypeData(itemTypeIndex).needsSaved = true; getItemTypeData(itemTypeIndex).needsSaved = true;
messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} base price to {ALTCOLOUR}$${orderPrice}`); messageAdmins(`{ALTCOLOUR}${getPlayerName(client)} set item type {ALTCOLOUR}${getItemTypeData(itemTypeIndex).name}{MAINCOLOUR} base price to {ALTCOLOUR}${getCurrencyString(orderPrice)}`);
} }
// =========================================================================== // ===========================================================================
@@ -2940,7 +2940,7 @@ function showBusinessFloorInventoryToPlayer(client, businessId) {
if (getBusinessData(businessId).floorItemCache == -1) { if (getBusinessData(businessId).floorItemCache == -1) {
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}{ALTCOLOUR}(Empty)`); itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}{ALTCOLOUR}(Empty)`);
} else { } else {
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}: {ALTCOLOUR}${getItemTypeData(getItemData(getBusinessData(businessId).floorItemCache[i]).itemTypeIndex).name} - ${(getPlayerCurrentSubAccount(client).cash > getItemData(getBusinessData(businessId).floorItemCache[i]).buyPrice) ? "{softGreen}" : "{softRed}"}$${getItemData(getBusinessData(businessId).floorItemCache[i]).buyPrice}`); itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}: {ALTCOLOUR}${getItemTypeData(getItemData(getBusinessData(businessId).floorItemCache[i]).itemTypeIndex).name} - ${(getPlayerCurrentSubAccount(client).cash > getItemData(getBusinessData(businessId).floorItemCache[i]).buyPrice) ? "{softGreen}" : "{softRed}"}${getCurrencyString(getItemData(getBusinessData(businessId).floorItemCache[i]).buyPrice)}`);
} }
} }

View File

@@ -2143,7 +2143,7 @@ function setJobRoutePayCommand(command, params, client) {
getJobData(jobId).routes[jobRoute].pay = toInteger(amount); getJobData(jobId).routes[jobRoute].pay = toInteger(amount);
getJobData(jobId).routes[jobRoute].needsSaved = true; getJobData(jobId).routes[jobRoute].needsSaved = true;
messageAdmins(`{adminOrange}${getPlayerName(client)} {MAINCOLOUR} set the pay for route {ALTCOLOUR}${getJobRouteData(jobId, jobRoute).name}{MAINCOLOUR} of the {jobYellow}${getJobData(jobId).name}{MAINCOLOUR} job to {ALTCOLOUR}$${makeLargeNumberReadable(amount)} {MAINCOLOUR} `); messageAdmins(`{adminOrange}${getPlayerName(client)} {MAINCOLOUR} set the pay for route {ALTCOLOUR}${getJobRouteData(jobId, jobRoute).name}{MAINCOLOUR} of the {jobYellow}${getJobData(jobId).name}{MAINCOLOUR} job to {ALTCOLOUR}${getCurrencyString(amount)} {MAINCOLOUR} `);
} }
// =========================================================================== // ===========================================================================
@@ -3860,7 +3860,7 @@ function finishSuccessfulJobRoute(client) {
let payout = toInteger(applyServerInflationMultiplier(jobRouteData.pay)); let payout = toInteger(applyServerInflationMultiplier(jobRouteData.pay));
getPlayerData(client).payDayAmount = getPlayerData(client).payDayAmount + payout; getPlayerData(client).payDayAmount = getPlayerData(client).payDayAmount + payout;
messageDiscordEventChannel(`💼 ${getCharacterFullName(client)} finished the ${jobRouteData.name} route for the ${getJobData(jobId).name} job and earned $${jobRouteData.pay}!`); messageDiscordEventChannel(`💼 ${getCharacterFullName(client)} finished the ${jobRouteData.name} route for the ${getJobData(jobId).name} job and earned ${getCurrencyString(jobRouteData.pay)}!`);
messagePlayerSuccess(client, replaceJobRouteStringsInMessage(jobRouteData.finishMessage, jobId, jobRouteData.index)); messagePlayerSuccess(client, replaceJobRouteStringsInMessage(jobRouteData.finishMessage, jobId, jobRouteData.index));
stopReturnToJobVehicleCountdown(client); stopReturnToJobVehicleCountdown(client);
@@ -3920,7 +3920,7 @@ function replaceJobRouteStringsInMessage(messageText, jobId, jobRouteId) {
tempFind = `{JOBROUTEPAY}`; tempFind = `{JOBROUTEPAY}`;
tempRegex = new RegExp(tempFind, 'g'); tempRegex = new RegExp(tempFind, 'g');
messageText = messageText.replace(tempRegex, `$${tempJobRouteData.pay}`); messageText = messageText.replace(tempRegex, `${getCurrencyString(tempJobRouteData.pay)}`);
tempFind = `{JOBNAME}`; tempFind = `{JOBNAME}`;
tempRegex = new RegExp(tempFind, 'g'); tempRegex = new RegExp(tempFind, 'g');

View File

@@ -144,7 +144,7 @@ function setNewCharacterMoneyCommand(command, params, client) {
getServerConfig().newCharacter.cash = amount; getServerConfig().newCharacter.cash = amount;
getServerConfig().needsSaved = true; getServerConfig().needsSaved = true;
messagePlayerNormal(client, `The new character money has been set to $${amount}`); messagePlayerNormal(client, `The new character money has been set to ${getCurrencyString(amount)}`);
return true; return true;
} }
@@ -457,7 +457,7 @@ function getPlayerInfoCommand(command, params, client) {
["Script Version", `${scriptVersion}`], ["Script Version", `${scriptVersion}`],
["Client Version", `${getPlayerData(targetClient).clientVersion}`], ["Client Version", `${getPlayerData(targetClient).clientVersion}`],
["Client Version", `${getPlayerData(targetClient).clientVersion}`], ["Client Version", `${getPlayerData(targetClient).clientVersion}`],
["Cash", `$${getPlayerCurrentSubAccount(client).cash}`], ["Cash", `${getCurrencyString(getPlayerCurrentSubAccount(client).cash)}`],
["Skin", `${skinName}{mediumGrey}[${skinModel}]{ALTCOLOUR}`], ["Skin", `${skinName}{mediumGrey}[${skinModel}]{ALTCOLOUR}`],
["Clan", `${clan}`], ["Clan", `${clan}`],
["Job", `${job}`], ["Job", `${job}`],

View File

@@ -1276,3 +1276,9 @@ function showSingleParticleEffect(position, particleEffectId, strength = 1.0, du
} }
// ========================================================================== // ==========================================================================
function sendPlayerCurrencyString(client) {
sendNetworkEventToPlayer("agrp.currencyString", client, getEconomyConfig().currencyString);
}
// ==========================================================================

View File

@@ -1181,9 +1181,9 @@ function givePlayerMoneyCommand(command, params, client) {
givePlayerCash(targetClient, toInteger(amount)); givePlayerCash(targetClient, toInteger(amount));
updatePlayerCash(targetClient); updatePlayerCash(targetClient);
//messagePlayerSuccess(client, `You gave {ALTCOLOUR}$${amount} {MAINCOLOUR}to {ALTCOLOUR}${getCharacterFullName(targetClient)}`); //messagePlayerSuccess(client, `You gave {ALTCOLOUR}${getCurrencyString(amount)} {MAINCOLOUR}to {ALTCOLOUR}${getCharacterFullName(targetClient)}`);
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} gave {ALTCOLOUR}$${amount}{MAINCOLOUR} to {ALTCOLOUR}${getCharacterFullName(targetClient)}`) messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} gave {ALTCOLOUR}${getCurrencyString(amount)}{MAINCOLOUR} to {ALTCOLOUR}${getCharacterFullName(targetClient)}`)
messagePlayerAlert(targetClient, `An admin gave you {ALTCOLOUR}$${amount}`); messagePlayerAlert(targetClient, `An admin gave you {ALTCOLOUR}${getCurrencyString(amount)}`);
} }
// =========================================================================== // ===========================================================================

View File

@@ -659,7 +659,7 @@ function vehicleAdminLiveryCommand(command, params, client) {
} }
if (getPlayerCurrentSubAccount(client).cash < getGlobalConfig().repairVehicleCost) { if (getPlayerCurrentSubAccount(client).cash < getGlobalConfig().repairVehicleCost) {
messagePlayerError(client, `You don't have enough money to change the vehicle's livery (need $${makeLargeNumberReadable(getGlobalConfig().resprayVehicleCost - getPlayerCurrentSubAccount(client).cash)} more!)`); messagePlayerError(client, `You don't have enough money to change the vehicle's livery (need ${getCurrencyString(getGlobalConfig().resprayVehicleCost - getPlayerCurrentSubAccount(client).cash)} more!)`);
return false; return false;
} }
@@ -1084,7 +1084,7 @@ function setVehicleRentPriceCommand(command, params, client) {
getVehicleData(vehicle).rentPrice = amount; getVehicleData(vehicle).rentPrice = amount;
getVehicleData(vehicle).needsSaved = true; getVehicleData(vehicle).needsSaved = true;
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} rent price to {ALTCOLOUR}$${makeLargeNumberReadable(amount)}`); messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}{MAINCOLOUR} rent price to {ALTCOLOUR}${getCurrencyString(amount)}`);
} }
// =========================================================================== // ===========================================================================
@@ -1113,7 +1113,7 @@ function setVehicleBuyPriceCommand(command, params, client) {
getVehicleData(vehicle).buyPrice = amount; getVehicleData(vehicle).buyPrice = amount;
getVehicleData(vehicle).needsSaved = true; getVehicleData(vehicle).needsSaved = true;
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}'s{MAINCOLOUR} buy price to {ALTCOLOUR}$${makeLargeNumberReadable(amount)}`); messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} set their {vehiclePurple}${getVehicleName(vehicle)}'s{MAINCOLOUR} buy price to {ALTCOLOUR}${getCurrencyString(amount)}`);
} }
// =========================================================================== // ===========================================================================