mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Update server_handleSafeGear.sqf
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
private ["_backpacks","_charID","_clientID","_dir","_holder","_lockCode","_lockedClass","_magazines","_name","_obj","_objectID","_objectUID","_ownerID","_packedClass","_player","_playerUID","_pos","_status","_statusText","_type","_unlockedClass","_vector","_weapons","_message","_suppliedCode","_damage"];
|
||||
private ["_backpacks","_charID","_clientID","_dir","_holder","_lockCode","_lockedClass","_magazines","_name","_obj","_objectID","_objectUID","_ownerID","_packedClass","_player","_playerUID","_pos","_status","_statusText","_type","_unlockedClass","_vector","_weapons","_message","_suppliedCode","_damage","_coins","_wealth"];
|
||||
|
||||
_player = _this select 0;
|
||||
_obj = _this select 1;
|
||||
@@ -50,6 +50,7 @@ call {
|
||||
_weapons = _obj getVariable ["WeaponCargo",[]];
|
||||
_magazines = _obj getVariable ["MagazineCargo",[]];
|
||||
_backpacks = _obj getVariable ["BackpackCargo",[]];
|
||||
if (Z_singleCurrency) then {_coins = _obj getVariable ["cashMoney",0];};
|
||||
_damage = damage _obj;
|
||||
|
||||
// Create new unlocked safe, then delete old locked safe
|
||||
@@ -64,6 +65,7 @@ call {
|
||||
_holder setVariable ["OEMPos",_pos,true];
|
||||
_holder setDamage _damage;
|
||||
if (DZE_permanentPlot) then {_holder setVariable ["ownerPUID",_ownerID,true];};
|
||||
if (Z_singleCurrency) then {_holder setVariable ["cashMoney",_coins,true];};
|
||||
deleteVehicle _obj;
|
||||
|
||||
[_weapons,_magazines,_backpacks,_holder] call fn_addCargo;
|
||||
@@ -76,6 +78,7 @@ call {
|
||||
_weapons = getWeaponCargo _obj;
|
||||
_magazines = getMagazineCargo _obj;
|
||||
_backpacks = getBackpackCargo _obj;
|
||||
if (Z_singleCurrency) then {_coins = _obj getVariable ["cashMoney",0];};
|
||||
_damage = damage _obj;
|
||||
|
||||
// Create new locked safe, then delete old unlocked safe
|
||||
@@ -90,6 +93,7 @@ call {
|
||||
_holder setVariable ["OEMPos",_pos,true];
|
||||
_holder setDamage _damage;
|
||||
if (DZE_permanentPlot) then {_holder setVariable ["ownerPUID",_ownerID,true];};
|
||||
if (Z_singleCurrency) then {_holder setVariable ["cashMoney",_coins,true];};
|
||||
deleteVehicle _obj;
|
||||
|
||||
// Local setVariable gear onto new locked safe for easy access on next unlock
|
||||
@@ -104,6 +108,7 @@ call {
|
||||
_weapons = getWeaponCargo _obj;
|
||||
_magazines = getMagazineCargo _obj;
|
||||
_backpacks = getBackpackCargo _obj;
|
||||
if (Z_singleCurrency) then {_coins = _obj getVariable ["cashMoney",0];};
|
||||
|
||||
_holder = _packedClass createVehicle [0,0,0];
|
||||
deleteVehicle _obj;
|
||||
@@ -111,6 +116,13 @@ call {
|
||||
_holder setPosATL _pos;
|
||||
_holder addMagazineCargoGlobal [getText(configFile >> "CfgVehicles" >> _packedClass >> "seedItem"),1];
|
||||
[_weapons,_magazines,_backpacks,_holder] call fn_addCargo;
|
||||
if (Z_singleCurrency && {_coins > 0}) then {
|
||||
_wealth = _player getVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),0];
|
||||
_player setVariable [(["cashMoney","globalMoney"] select Z_persistentMoney),_wealth + _coins,true];
|
||||
|
||||
RemoteMessage = ["systemChat",["STR_CL_ZSC_PACK_WARNING",_type,[_coins] call BIS_fnc_numberText,CurrencyName]];
|
||||
(owner _player) publicVariableClient "RemoteMessage";
|
||||
};
|
||||
|
||||
// Delete safe from database
|
||||
[_objectID,_objectUID,_obj] call server_deleteObjDirect;
|
||||
|
||||
Reference in New Issue
Block a user