Update PVDZ_plr_save in advanced trading

This commit is contained in:
ebaydayz
2016-05-01 13:21:13 -04:00
parent 1e65f7a959
commit b4cd47f5b5
3 changed files with 7 additions and 6 deletions

View File

@@ -4,8 +4,9 @@ _amount = _this select 1;
_result = false; _result = false;
_wealth = _player getVariable[Z_MoneyVariable,0]; _wealth = _player getVariable[Z_MoneyVariable,0];
_player setVariable[Z_MoneyVariable,_wealth + _amount, true]; _player setVariable[Z_MoneyVariable,_wealth + _amount, true];
PVDZE_plr_Save = [_player,(magazines _player),true,true] ; // can't use (magazines _player), server_playerSync expects nested array with ammo counts from player_countMagazines
publicVariableServer "PVDZE_plr_Save"; // also fourth parameter in PVDZ_plr_Save is now used for achievements
if (_player == player) then {call player_forceSave;};
_player setVariable ["moneychanged",1,true]; _player setVariable ["moneychanged",1,true];
_newwealth = _player getVariable[Z_MoneyVariable,0]; _newwealth = _player getVariable[Z_MoneyVariable,0];
if (_newwealth >= _wealth) then { _result = true; }; if (_newwealth >= _wealth) then { _result = true; };

View File

@@ -11,8 +11,9 @@ _newwealth = _wealth - _amount;
_player setVariable[Z_MoneyVariable,_newwealth, true]; _player setVariable[Z_MoneyVariable,_newwealth, true];
_player setVariable ["moneychanged",1,true]; _player setVariable ["moneychanged",1,true];
_result = true; _result = true;
PVDZE_plr_Save = [_player,(magazines _player),true,true] ; // can't use (magazines _player), server_playerSync expects nested array with ammo counts from player_countMagazines
publicVariableServer "PVDZE_plr_Save"; // also fourth parameter in PVDZ_plr_Save is now used for achievements
if (_player == player) then {call player_forceSave;};
}; };
}else{ }else{
_result = true; _result = true;

View File

@@ -6,7 +6,7 @@ if( isNil "Z_traderData" || count (Z_traderData) == 0)exitWith{
cutText [format["There went something wrong selecting the trader."], "PLAIN DOWN"]; cutText [format["There went something wrong selecting the trader."], "PLAIN DOWN"];
}; };
if(DZE_ActionInProgress) exitWith { cutText ['There is already an action in progress.' , "PLAIN DOWN"] }; if(DZE_ActionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
if(isNil "Z_AdvancedTradingInit")then{ if(isNil "Z_AdvancedTradingInit")then{
@@ -54,7 +54,6 @@ if(isNil "Z_AdvancedTradingInit")then{
/* end script config */ /* end script config */
fnc_inString = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\fnc_inString.sqf");
ZUPA_fnc_removeWeaponsAndMagazinesCargo = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\zupa_fnc_removeWeaponsAndMagazinesCargo.sqf"); ZUPA_fnc_removeWeaponsAndMagazinesCargo = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\zupa_fnc_removeWeaponsAndMagazinesCargo.sqf");
Z_filleTradeTitle = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_filleTradeTitle.sqf"); Z_filleTradeTitle = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_filleTradeTitle.sqf");