diff --git a/SQF/dayz_code/compile/player_humanityMorph.sqf b/SQF/dayz_code/compile/player_humanityMorph.sqf index f539408e6..e170141ae 100644 --- a/SQF/dayz_code/compile/player_humanityMorph.sqf +++ b/SQF/dayz_code/compile/player_humanityMorph.sqf @@ -1,4 +1,4 @@ -private ["_charID","_newmodel","_old","_updates","_humanity","_medical","_worldspace","_zombieKills","_headShots","_humanKills","_combattimeout","_inCombat","_banditKills","_fractures","_wpnType","_ismelee","_coins"]; +private ["_charID","_newmodel","_old","_updates","_humanity","_medical","_worldspace","_zombieKills","_headShots","_humanKills","_combattimeout","_inCombat","_banditKills","_fractures","_wpnType","_ismelee","_coins","_bankCoins","_globalCoins"]; //_playerUID = _this select 0; _charID = _this select 1; _model = _this select 2; @@ -29,7 +29,12 @@ _ConfirmedHumanKills = player getVariable ["ConfirmedHumanKills",0]; _ConfirmedBanditKills = player getVariable ["ConfirmedBanditKills",0]; _friendlies = player getVariable ["friendlies",[]]; _tagSetting = player getVariable ["DZE_display_name",false]; -if (Z_SingleCurrency) then {_coins = player getVariable [Z_moneyVariable,0];}; + +if (Z_SingleCurrency) then { + _coins = player getVariable [Z_moneyVariable,0]; + _bankCoins = player getVariable [Z_bankVariable,0]; + _globalCoins = player getVariable [Z_globalVariable,0]; +}; //Switch _model call player_switchModel; //Already spawned thread, no need to spawn and waitUntil script is done @@ -90,7 +95,12 @@ player setVariable ["ConfirmedHumanKills",_ConfirmedHumanKills,true]; player setVariable ["ConfirmedBanditKills",_ConfirmedBanditKills,true]; player setVariable ["friendlies",_friendlies,true]; player setVariable ["DZE_display_name",_tagSetting,true]; -if (Z_SingleCurrency) then {player setVariable [Z_moneyVariable,_coins,true];}; + +if (Z_SingleCurrency) then { + player setVariable [Z_moneyVariable,_coins,true]; + player setVariable [Z_bankVariable,_bankCoins,true]; + player setVariable [Z_globalVariable,_globalCoins,true]; +}; //PVDZ_serverStoreVar = [player,"Achievements",_achievements]; //publicVariableServer "PVDZ_serverStoreVar"; diff --git a/SQF/dayz_code/configVariables.sqf b/SQF/dayz_code/configVariables.sqf index 2e41d9d97..2c82c484a 100644 --- a/SQF/dayz_code/configVariables.sqf +++ b/SQF/dayz_code/configVariables.sqf @@ -68,7 +68,9 @@ Z_AllowTakingMoneyFromBackpack = true; // Allow traders to take money from backp Z_AllowTakingMoneyFromVehicle = true; // Allow traders to take money from vehicles when buying with default currency. Z_SingleCurrency = false; // Does your server use a single currency system? CurrencyName = "Coins"; // If using single currency this is the currency display name. -Z_MoneyVariable = "cashMoney"; // If using single currency this is the variable name used to store player wealth. +Z_moneyVariable = "cashMoney"; // If using single currency this is the variable name used to store player wealth. +Z_bankVariable = "moneySpecial"; // If using single currency this is the variable name used to store object bank wealth. +Z_globalVariable = "GlobalMoney"; // If using single currency this is the variable name used to store coins globally. DZE_MoneyStorageClasses = []; // If using single currency this is an array of object classes players can store coins in. // Plot Management and Plot for Life diff --git a/SQF/dayz_code/system/player_monitor.fsm b/SQF/dayz_code/system/player_monitor.fsm index 5645f8632..f9fbc2dc3 100644 --- a/SQF/dayz_code/system/player_monitor.fsm +++ b/SQF/dayz_code/system/player_monitor.fsm @@ -488,7 +488,7 @@ class FSM "_isInfected = false;" \n "_characterCoins = 0;" \n "_globalCoins = 0;" \n - "_CoinsSpecial = 0;" \n + "_bankCoins = 0;" \n "" \n "if (count _msg > 7) then {" \n " _isHiveOk = _msg select 7;" \n @@ -496,7 +496,7 @@ class FSM " _isInfected = _msg select 9;" \n " _characterCoins = _msg select 11;" \n " _globalCoins = _msg select 12;" \n - " _CoinsSpecial = _msg select 13;" \n + " _bankCoins = _msg select 13;" \n " diag_log (""PLAYER RESULT: "" + str(_isHiveOk));" \n "};" \n "" \n @@ -1159,8 +1159,8 @@ class FSM "" \n "if (Z_SingleCurrency) then {" \n " player setVariable [Z_MoneyVariable, _characterCoins, true];" \n - " player setVariable [""GlobalMoney"", _globalCoins, true];" \n - " player setVariable [""MoneySpecial"", _CoinsSpecial, true];" \n + " player setVariable [Z_globalVariable, _globalCoins, true];" \n + " player setVariable [Z_BankVariable, _bankCoins, true];" \n "};" \n "dayz_musicH = [] spawn player_music;" \n "dayz_slowCheck = [] spawn player_spawn_2;" \n diff --git a/SQF/dayz_server/compile/server_playerSync.sqf b/SQF/dayz_server/compile/server_playerSync.sqf index a276c80ca..39dfdd941 100644 --- a/SQF/dayz_server/compile/server_playerSync.sqf +++ b/SQF/dayz_server/compile/server_playerSync.sqf @@ -36,8 +36,8 @@ _medical = []; _distanceFoot = 0; //all getVariable immediately -_globalCoins = _character getVariable ["GlobalMoney", -1]; -_bankCoins = _character getVariable ["MoneySpecial", -1]; +_globalCoins = _character getVariable [Z_globalVariable, -1]; +_bankCoins = _character getVariable [Z_BankVariable, -1]; _coins = _character getVariable [Z_MoneyVariable, -1]; //should getting coins fail set the variable to an invalid value to prevent overwritting the in the DB _lastPos = _character getVariable ["lastPos",_charPos]; _usec_Dead = _character getVariable ["USEC_isDead",false];