mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +03:00
Standardize coin variables, prevent coins not refreshing on skin change. (#1904)
* Standardize coin variables, prevent coins not refreshing on skin change. * Add missing commit
This commit is contained in:
@@ -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;
|
//_playerUID = _this select 0;
|
||||||
_charID = _this select 1;
|
_charID = _this select 1;
|
||||||
_model = _this select 2;
|
_model = _this select 2;
|
||||||
@@ -29,7 +29,12 @@ _ConfirmedHumanKills = player getVariable ["ConfirmedHumanKills",0];
|
|||||||
_ConfirmedBanditKills = player getVariable ["ConfirmedBanditKills",0];
|
_ConfirmedBanditKills = player getVariable ["ConfirmedBanditKills",0];
|
||||||
_friendlies = player getVariable ["friendlies",[]];
|
_friendlies = player getVariable ["friendlies",[]];
|
||||||
_tagSetting = player getVariable ["DZE_display_name",false];
|
_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
|
//Switch
|
||||||
_model call player_switchModel; //Already spawned thread, no need to spawn and waitUntil script is done
|
_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 ["ConfirmedBanditKills",_ConfirmedBanditKills,true];
|
||||||
player setVariable ["friendlies",_friendlies,true];
|
player setVariable ["friendlies",_friendlies,true];
|
||||||
player setVariable ["DZE_display_name",_tagSetting,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];
|
//PVDZ_serverStoreVar = [player,"Achievements",_achievements];
|
||||||
//publicVariableServer "PVDZ_serverStoreVar";
|
//publicVariableServer "PVDZ_serverStoreVar";
|
||||||
|
|||||||
@@ -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_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?
|
Z_SingleCurrency = false; // Does your server use a single currency system?
|
||||||
CurrencyName = "Coins"; // If using single currency this is the currency display name.
|
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.
|
DZE_MoneyStorageClasses = []; // If using single currency this is an array of object classes players can store coins in.
|
||||||
|
|
||||||
// Plot Management and Plot for Life
|
// Plot Management and Plot for Life
|
||||||
|
|||||||
@@ -488,7 +488,7 @@ class FSM
|
|||||||
"_isInfected = false;" \n
|
"_isInfected = false;" \n
|
||||||
"_characterCoins = 0;" \n
|
"_characterCoins = 0;" \n
|
||||||
"_globalCoins = 0;" \n
|
"_globalCoins = 0;" \n
|
||||||
"_CoinsSpecial = 0;" \n
|
"_bankCoins = 0;" \n
|
||||||
"" \n
|
"" \n
|
||||||
"if (count _msg > 7) then {" \n
|
"if (count _msg > 7) then {" \n
|
||||||
" _isHiveOk = _msg select 7;" \n
|
" _isHiveOk = _msg select 7;" \n
|
||||||
@@ -496,7 +496,7 @@ class FSM
|
|||||||
" _isInfected = _msg select 9;" \n
|
" _isInfected = _msg select 9;" \n
|
||||||
" _characterCoins = _msg select 11;" \n
|
" _characterCoins = _msg select 11;" \n
|
||||||
" _globalCoins = _msg select 12;" \n
|
" _globalCoins = _msg select 12;" \n
|
||||||
" _CoinsSpecial = _msg select 13;" \n
|
" _bankCoins = _msg select 13;" \n
|
||||||
" diag_log (""PLAYER RESULT: "" + str(_isHiveOk));" \n
|
" diag_log (""PLAYER RESULT: "" + str(_isHiveOk));" \n
|
||||||
"};" \n
|
"};" \n
|
||||||
"" \n
|
"" \n
|
||||||
@@ -1159,8 +1159,8 @@ class FSM
|
|||||||
"" \n
|
"" \n
|
||||||
"if (Z_SingleCurrency) then {" \n
|
"if (Z_SingleCurrency) then {" \n
|
||||||
" player setVariable [Z_MoneyVariable, _characterCoins, true];" \n
|
" player setVariable [Z_MoneyVariable, _characterCoins, true];" \n
|
||||||
" player setVariable [""GlobalMoney"", _globalCoins, true];" \n
|
" player setVariable [Z_globalVariable, _globalCoins, true];" \n
|
||||||
" player setVariable [""MoneySpecial"", _CoinsSpecial, true];" \n
|
" player setVariable [Z_BankVariable, _bankCoins, true];" \n
|
||||||
"};" \n
|
"};" \n
|
||||||
"dayz_musicH = [] spawn player_music;" \n
|
"dayz_musicH = [] spawn player_music;" \n
|
||||||
"dayz_slowCheck = [] spawn player_spawn_2;" \n
|
"dayz_slowCheck = [] spawn player_spawn_2;" \n
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ _medical = [];
|
|||||||
_distanceFoot = 0;
|
_distanceFoot = 0;
|
||||||
|
|
||||||
//all getVariable immediately
|
//all getVariable immediately
|
||||||
_globalCoins = _character getVariable ["GlobalMoney", -1];
|
_globalCoins = _character getVariable [Z_globalVariable, -1];
|
||||||
_bankCoins = _character getVariable ["MoneySpecial", -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
|
_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];
|
_lastPos = _character getVariable ["lastPos",_charPos];
|
||||||
_usec_Dead = _character getVariable ["USEC_isDead",false];
|
_usec_Dead = _character getVariable ["USEC_isDead",false];
|
||||||
|
|||||||
Reference in New Issue
Block a user