Add local money
This commit is contained in:
@@ -8,38 +8,6 @@
|
|||||||
// TYPE: Client (JavaScript)
|
// TYPE: Client (JavaScript)
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
let currencyString = "${AMOUNT}";
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function getCurrencyString(amount) {
|
|
||||||
let tempString = currencyString;
|
|
||||||
tempString = tempString.replace("{AMOUNT}", toString(makeLargeNumberReadable(amount)));
|
|
||||||
return tempString;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function updateLocalPlayerMoney() {
|
|
||||||
if (localPlayer == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof localPlayer.money != "undefined") {
|
|
||||||
localPlayer.money = toInteger(amount);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getGame() == AGRP_GAME_GTA_IV) {
|
|
||||||
natives.setMultiplayerHudCash(amount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
|
||||||
|
|
||||||
function setLocalPlayerMoney(amount) {
|
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting local player money`);
|
|
||||||
localPlayerCash = amount;
|
|
||||||
updateLocalPlayerMoney();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
@@ -92,6 +92,9 @@ let serverData = {
|
|||||||
jobs: [],
|
jobs: [],
|
||||||
};
|
};
|
||||||
|
|
||||||
let localPlayerCash = 0;
|
let localPlayerMoney = 0;
|
||||||
|
let localPlayerMoneyInterval = null;
|
||||||
|
|
||||||
|
let currencyString = "${AMOUNT}";
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
@@ -558,8 +558,6 @@ function setProfanityFilterState(state) {
|
|||||||
updateChatBox();
|
updateChatBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function processVehicleCruiseControl() {
|
function processVehicleCruiseControl() {
|
||||||
@@ -579,3 +577,37 @@ function processVehicleCruiseControl() {
|
|||||||
setVehicleSpeed(cruiseControlSpeed);
|
setVehicleSpeed(cruiseControlSpeed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function getCurrencyString(amount) {
|
||||||
|
let tempString = currencyString;
|
||||||
|
tempString = tempString.replace("{AMOUNT}", toString(makeLargeNumberReadable(amount)));
|
||||||
|
return tempString;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function updateLocalPlayerMoney() {
|
||||||
|
if (localPlayer == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof localPlayer.money != "undefined") {
|
||||||
|
localPlayer.money = toInteger(amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getGame() == AGRP_GAME_GTA_IV) {
|
||||||
|
natives.setMultiplayerHudCash(amount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function setLocalPlayerMoney(amount) {
|
||||||
|
logToConsole(LOG_DEBUG, `[VRR.Utilities] Setting local player money`);
|
||||||
|
localPlayerMoney = amount;
|
||||||
|
updateLocalPlayerMoney();
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
Reference in New Issue
Block a user