Use new currency string
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
"applyUpkeep": true,
|
||||
"grossIncomeMultiplier": 1.0,
|
||||
"incomeTaxRate": 0.7,
|
||||
"currencyString": "${AMOUNT}",
|
||||
"upKeepCosts": {
|
||||
"upKeepPerVehicle": 250,
|
||||
"upKeepPerHouse": 350,
|
||||
|
||||
27
scripts/client/economy.js
Normal file
27
scripts/client/economy.js
Normal 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;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -162,7 +162,7 @@ function showCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, ski
|
||||
setChatWindowEnabled(false);
|
||||
mexui.setInput(true);
|
||||
characterSelect.nameText.text = `${firstName} ${lastName}`;
|
||||
characterSelect.cashText.text = `Money: $${cash}`;
|
||||
characterSelect.cashText.text = `Money: ${getCurrencyString(cash)}`;
|
||||
characterSelect.clanText.text = `Clan: ${clan}`;
|
||||
characterSelect.lastPlayedText.text = `Last Played: ${lastPlayed}`;
|
||||
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);
|
||||
characterSelect.window.shown = false;
|
||||
characterSelect.nameText.text = `${firstName} ${lastName}`;
|
||||
characterSelect.cashText.text = `Money: $${cash}`;
|
||||
characterSelect.cashText.text = `Money: ${getCurrencyString(cash)}`;
|
||||
characterSelect.clanText.text = `Clan: ${clan}`;
|
||||
characterSelect.lastPlayedText.text = `Last Played: ${lastPlayed}`;
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@ function addAllNetworkHandlers() {
|
||||
addNetworkEventHandler("agrp.veh.engine", setVehicleEngine);
|
||||
addNetworkEventHandler("agrp.veh.repair", repairVehicle);
|
||||
addNetworkEventHandler("agrp.cruiseControl", toggleVehicleCruiseControl);
|
||||
addNetworkEventHandler("agrp.passenger", enterVehicleAsPassenger);
|
||||
|
||||
// Radio
|
||||
addNetworkEventHandler("agrp.radioStream", playStreamingRadio);
|
||||
@@ -109,6 +110,11 @@ function addAllNetworkHandlers() {
|
||||
addNetworkEventHandler("agrp.showLocaleChooser", showLocaleChooserGUI);
|
||||
addNetworkEventHandler("agrp.guiColour", setGUIColours);
|
||||
|
||||
// 2D Rendering
|
||||
addNetworkEventHandler("agrp.set2DRendering", set2DRendering);
|
||||
addNetworkEventHandler("agrp.logo", setServerLogoRenderState);
|
||||
addNetworkEventHandler("agrp.showItemActionDelay", showItemActionDelay);
|
||||
|
||||
// Business
|
||||
addNetworkEventHandler("agrp.business", receiveBusinessFromServer);
|
||||
|
||||
@@ -122,13 +128,20 @@ function addAllNetworkHandlers() {
|
||||
addNetworkEventHandler("agrp.locale", setLocale);
|
||||
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
|
||||
addNetworkEventHandler("agrp.mouseCursor", toggleMouseCursor);
|
||||
addNetworkEventHandler("agrp.mouseCamera", toggleMouseCamera);
|
||||
addNetworkEventHandler("agrp.clearPeds", clearLocalPlayerOwnedPeds);
|
||||
addNetworkEventHandler("agrp.clearPickups", clearLocalPlayerOwnedPickups);
|
||||
addNetworkEventHandler("agrp.passenger", enterVehicleAsPassenger);
|
||||
addNetworkEventHandler("agrp.logo", setServerLogoRenderState);
|
||||
addNetworkEventHandler("agrp.ambience", setCityAmbienceState);
|
||||
addNetworkEventHandler("agrp.runCode", runClientCode);
|
||||
addNetworkEventHandler("agrp.minuteDuration", setMinuteDuration);
|
||||
@@ -136,17 +149,10 @@ function addAllNetworkHandlers() {
|
||||
addNetworkEventHandler("agrp.enterPropertyKey", setEnterPropertyKey);
|
||||
addNetworkEventHandler("agrp.skinSelect", toggleSkinSelect);
|
||||
addNetworkEventHandler("agrp.hotbar", updatePlayerHotBar);
|
||||
addNetworkEventHandler("agrp.showItemActionDelay", showItemActionDelay);
|
||||
addNetworkEventHandler("agrp.set2DRendering", set2DRendering);
|
||||
addNetworkEventHandler("agrp.mouseCameraForce", setMouseCameraState);
|
||||
addNetworkEventHandler("agrp.logLevel", setLogLevel);
|
||||
addNetworkEventHandler("agrp.hideAllGUI", hideAllGUI);
|
||||
addNetworkEventHandler("agrp.nametag", updatePlayerNameTag);
|
||||
addNetworkEventHandler("agrp.nametagDistance", setNameTagDistance);
|
||||
addNetworkEventHandler("agrp.ping", updatePlayerPing);
|
||||
addNetworkEventHandler("agrp.anim", makePedPlayAnimation);
|
||||
addNetworkEventHandler("agrp.stopAnim", makePedStopAnimation);
|
||||
addNetworkEventHandler("agrp.forceAnim", forcePedAnimation);
|
||||
addNetworkEventHandler("agrp.clientInfo", serverRequestedClientInfo);
|
||||
addNetworkEventHandler("agrp.interiorLights", updateInteriorLightsState);
|
||||
addNetworkEventHandler("agrp.cutsceneInterior", setCutsceneInterior);
|
||||
@@ -156,6 +162,7 @@ function addAllNetworkHandlers() {
|
||||
addNetworkEventHandler("agrp.vehBuyState", setVehiclePurchaseState);
|
||||
addNetworkEventHandler("agrp.holdObject", makePedHoldObject);
|
||||
addNetworkEventHandler("agrp.profanityFilter", setProfanityFilterState);
|
||||
addNetworkEventHandler("agrp.currencyString", receiveCurrencyStringFromServer);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -847,7 +847,7 @@ function setBusinessEntranceFeeCommand(command, params, client) {
|
||||
|
||||
getBusinessData(businessId).entranceFee = entranceFee;
|
||||
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}`],
|
||||
[`Owner`, `${ownerName} (${getBusinessOwnerTypeText(businessData.ownerType)})`],
|
||||
[`Locked`, `${getLockedUnlockedFromBool(businessData.locked)}`],
|
||||
[`BuyPrice`, `$${businessData.buyPrice}`],
|
||||
[`BuyPrice`, `${getCurrencyString(businessData.buyPrice)}`],
|
||||
//[`RentPrice`, `${businessData.rentPrice}`],
|
||||
[`HasInterior`, `${getYesNoFromBool(businessData.hasInterior)}`],
|
||||
[`CustomInterior`, `${getYesNoFromBool(businessData.customInterior)}`],
|
||||
[`HasBuyableItems`, `${getYesNoFromBool(doesBusinessHaveAnyItemsToBuy(businessId))}`],
|
||||
[`EntranceFee`, `$${businessData.entranceFee}`],
|
||||
[`EntranceFee`, `${getCurrencyString(businessData.entranceFee)}`],
|
||||
[`InteriorLights`, `${getOnOffFromBool(businessData.interiorLights)}`],
|
||||
[`Balance`, `$${businessData.till}`],
|
||||
[`Balance`, `${getCurrencyString(businessData.till)}`],
|
||||
[`RadioStation`, `${businessData.streamingRadioStation}`],
|
||||
[`LabelHelpType`, `${businessData.labelHelpType}`],
|
||||
];
|
||||
@@ -1409,7 +1409,7 @@ function withdrawFromBusinessCommand(command, params, client) {
|
||||
updatePlayerCash(client);
|
||||
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);
|
||||
|
||||
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) {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1495,7 +1495,7 @@ function depositIntoBusinessCommand(command, params, client) {
|
||||
updatePlayerCash(client);
|
||||
|
||||
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;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1574,13 +1574,13 @@ function orderItemForBusinessCommand(command, params, client) {
|
||||
function orderItemForBusiness(businessId, itemType, amount) {
|
||||
if (getBusinessData(businessId).till < orderTotalCost) {
|
||||
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;
|
||||
}
|
||||
|
||||
getBusinessData(businessId).till -= orderTotalCost;
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
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)}`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -47,15 +47,15 @@ function playerPayDay(client) {
|
||||
let netIncome = Math.round(grossIncome - incomeTaxAmount);
|
||||
|
||||
messagePlayerAlert(client, "== Payday! =============================");
|
||||
messagePlayerInfo(client, `Paycheck: {ALTCOLOUR}$${grossIncome}`);
|
||||
messagePlayerInfo(client, `Taxes: {ALTCOLOUR}$${incomeTaxAmount}`);
|
||||
messagePlayerInfo(client, `You receive: {ALTCOLOUR}$${netIncome}`);
|
||||
messagePlayerInfo(client, `Paycheck: {ALTCOLOUR}${getCurrencyString(grossIncome)}`);
|
||||
messagePlayerInfo(client, `Taxes: {ALTCOLOUR}${getCurrencyString(incomeTaxAmount)}`);
|
||||
messagePlayerInfo(client, `You receive: {ALTCOLOUR}${getCurrencyString(netIncome)}`);
|
||||
if (netIncome < incomeTaxAmount) {
|
||||
let totalCash = getPlayerCash(client);
|
||||
let canPayNow = totalCash + netIncome;
|
||||
if (incomeTaxAmount <= 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, "NextPaycheckRepossessionWarning")}`);
|
||||
} else {
|
||||
@@ -141,14 +141,14 @@ function setPayDayBonusMultiplier(command, params, client) {
|
||||
function taxInfoCommand(command, params, client) {
|
||||
let wealth = calculateWealth(client);
|
||||
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) {
|
||||
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.`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -213,4 +213,12 @@ function isDoubleBonusActive() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function getCurrencyString(amount) {
|
||||
let tempString = getEconomyConfig().currencyString
|
||||
tempString = tempString.replace("{AMOUNT}", toString(makeLargeNumberReadable(amount)));
|
||||
return tempString;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -694,14 +694,14 @@ function onPedEnteredVehicle(event, ped, vehicle, seat) {
|
||||
vehicle.engine = getVehicleData(vehicle).engine;
|
||||
|
||||
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);
|
||||
} else if (getVehicleData(vehicle).rentPrice > 0) {
|
||||
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);
|
||||
} 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 {
|
||||
let ownerName = "Nobody";
|
||||
|
||||
@@ -1384,7 +1384,7 @@ function setHouseBuyPriceCommand(command, params, client) {
|
||||
getHouseData(houseId).buyPrice = amount;
|
||||
getHouseData(houseId).needsSaved = true;
|
||||
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).needsSaved = true;
|
||||
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)}`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -887,7 +887,7 @@ function setItemTypeOrderPriceCommand(command, params, client) {
|
||||
|
||||
getItemTypeData(itemTypeIndex).orderPrice = orderPrice;
|
||||
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) {
|
||||
itemDisplay.push(`{MAINCOLOUR}${toInteger(i) + 1}{ALTCOLOUR}(Empty)`);
|
||||
} 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)}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2143,7 +2143,7 @@ function setJobRoutePayCommand(command, params, client) {
|
||||
|
||||
getJobData(jobId).routes[jobRoute].pay = toInteger(amount);
|
||||
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));
|
||||
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));
|
||||
|
||||
stopReturnToJobVehicleCountdown(client);
|
||||
@@ -3920,7 +3920,7 @@ function replaceJobRouteStringsInMessage(messageText, jobId, jobRouteId) {
|
||||
|
||||
tempFind = `{JOBROUTEPAY}`;
|
||||
tempRegex = new RegExp(tempFind, 'g');
|
||||
messageText = messageText.replace(tempRegex, `$${tempJobRouteData.pay}`);
|
||||
messageText = messageText.replace(tempRegex, `${getCurrencyString(tempJobRouteData.pay)}`);
|
||||
|
||||
tempFind = `{JOBNAME}`;
|
||||
tempRegex = new RegExp(tempFind, 'g');
|
||||
|
||||
@@ -144,7 +144,7 @@ function setNewCharacterMoneyCommand(command, params, client) {
|
||||
getServerConfig().newCharacter.cash = amount;
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -457,7 +457,7 @@ function getPlayerInfoCommand(command, params, client) {
|
||||
["Script Version", `${scriptVersion}`],
|
||||
["Client Version", `${getPlayerData(targetClient).clientVersion}`],
|
||||
["Client Version", `${getPlayerData(targetClient).clientVersion}`],
|
||||
["Cash", `$${getPlayerCurrentSubAccount(client).cash}`],
|
||||
["Cash", `${getCurrencyString(getPlayerCurrentSubAccount(client).cash)}`],
|
||||
["Skin", `${skinName}{mediumGrey}[${skinModel}]{ALTCOLOUR}`],
|
||||
["Clan", `${clan}`],
|
||||
["Job", `${job}`],
|
||||
|
||||
@@ -1275,4 +1275,10 @@ function showSingleParticleEffect(position, particleEffectId, strength = 1.0, du
|
||||
sendNetworkEventToPlayer("agrp.particleEffectSingle", null, position, particleEffectId, strength, duration);
|
||||
}
|
||||
|
||||
// ==========================================================================
|
||||
|
||||
function sendPlayerCurrencyString(client) {
|
||||
sendNetworkEventToPlayer("agrp.currencyString", client, getEconomyConfig().currencyString);
|
||||
}
|
||||
|
||||
// ==========================================================================
|
||||
@@ -1181,9 +1181,9 @@ function givePlayerMoneyCommand(command, params, client) {
|
||||
|
||||
givePlayerCash(targetClient, toInteger(amount));
|
||||
updatePlayerCash(targetClient);
|
||||
//messagePlayerSuccess(client, `You gave {ALTCOLOUR}$${amount} {MAINCOLOUR}to {ALTCOLOUR}${getCharacterFullName(targetClient)}`);
|
||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} gave {ALTCOLOUR}$${amount}{MAINCOLOUR} to {ALTCOLOUR}${getCharacterFullName(targetClient)}`)
|
||||
messagePlayerAlert(targetClient, `An admin gave you {ALTCOLOUR}$${amount}`);
|
||||
//messagePlayerSuccess(client, `You gave {ALTCOLOUR}${getCurrencyString(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}${getCurrencyString(amount)}`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -659,7 +659,7 @@ function vehicleAdminLiveryCommand(command, params, client) {
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1084,7 +1084,7 @@ function setVehicleRentPriceCommand(command, params, client) {
|
||||
getVehicleData(vehicle).rentPrice = amount;
|
||||
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).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)}`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
Reference in New Issue
Block a user