Hi all,
I have tried editing this file half a dozen times and broken the script every time. I need to merge these two sections together so I can keep my gold coin and plot management working but add origins building stuff.
and
together and can't for the life of me figure out how. Any help would be GREATLY appreciated.
I have tried editing this file half a dozen times and broken the script every time. I need to merge these two sections together so I can keep my gold coin and plot management working but add origins building stuff.
Code:
_object_inventory = {
private["_inventory","_previous","_key","_updateGear"];
_updateGear = false;
if((typeOf _object) in DZE_Origins_Buildings) then {
_state = _object getVariable ["CanBeUpdated",false];
if(_state) then {
_updateGear = true;
_object setVariable ["WeaponCargo", getWeaponCargo _object,true];
_object setVariable ["MagazineCargo", getMagazineCargo _object,true];
_object setVariable ["BackpackCargo", getBackpackCargo _object,true];
_inventory = [
_object getVariable["WeaponCargo",[]],
_object getVariable["MagazineCargo",[]],
_object getVariable["BackpackCargo",[]]
];
};
} else {
_updateGear = true;
_inventory = [
getWeaponCargo _object,
getMagazineCargo _object,
getBackpackCargo _object
];
};
if(_updateGear) then {
_previous = str(_object getVariable["lastInventory",[]]);
if (str(_inventory) != _previous) then {
_object setVariable["lastInventory",_inventory];
if (_objectID == "0") then {
_key = format["CHILD:309:%1:%2:",_uid,_inventory];
} else {
_key = format["CHILD:303:%1:%2:",_objectID,_inventory];
};
//diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
};
};
};
and
Code:
_object_inventory = {
private["_inventory","_previous","_key"];
if (typeOf (_object) == "Plastic_Pole_EP1_DZ") then{
_inventory = _object getVariable ["plotfriends", []]; //We're replacing the inventory with UIDs for this item
} else {
_inventory = [
getWeaponCargo _object,
getMagazineCargo _object,
getBackpackCargo _object
/*ZSC*/
, _object getVariable["bankMoney",0]
/*ZSC*/
];
};
_previous = str(_object getVariable["lastInventory",[]]);
if (str(_inventory) != _previous) then {
_object setVariable["lastInventory",_inventory];
if (_objectID == "0") then {
_key = format["CHILD:309:%1:%2:",_uid,_inventory];
} else {
_key = format["CHILD:303:%1:%2:",_objectID,_inventory];
};
//diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
};
};
together and can't for the life of me figure out how. Any help would be GREATLY appreciated.