Optimize money sync

This commit is contained in:
Vortrex
2022-09-06 06:57:46 -05:00
parent bbfcc56013
commit 670efb53d6
2 changed files with 25 additions and 1 deletions

View File

@@ -18,4 +18,28 @@ function getCurrencyString(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();
}
// ===========================================================================