Jump to content

After installing gold coins everything in safes, vehicles, etc. gets deleted after server restart! HELP


Recommended Posts

I checked and my RPT logs are fully clean

this is my server_updateObject.sqf that I have edited in the tutorial.

_object_inventory = {
	private["_inventory","_previous","_key"];
		_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;
		};
};
Link to comment
Share on other sites

  • 4 weeks later...

Your Issue is a Comma. Change this:

 

_inventory = [
			getWeaponCargo _object,
			getMagazineCargo _object,
			getBackpackCargo _object
			/*ZSC*/
			, _object getVariable["bankMoney",0]
			/*ZSC*/
		];

To this:
 

_inventory = [
			getWeaponCargo _object,
			getMagazineCargo _object,
			getBackpackCargo _object,
			/*ZSC*/
			, _object getVariable["bankMoney",0]
			/*ZSC*/
		];
Link to comment
Share on other sites

  • 1 month later...

 

Your Issue is a Comma. Change this:

 

_inventory = [
			getWeaponCargo _object,
			getMagazineCargo _object,
			getBackpackCargo _object
			/*ZSC*/
			, _object getVariable["bankMoney",0]
			/*ZSC*/
		];

To this:

 

_inventory = [
			getWeaponCargo _object,
			getMagazineCargo _object,
			getBackpackCargo _object,
			/*ZSC*/
			, _object getVariable["bankMoney",0]
			/*ZSC*/
		];

It already has the comma - , _object getVariable["bankMoney",0]

I had this issue at first too and it was because I did not see that comma the first time. The way his is is correct, it's something else causing it. I don't know what though. Mine is exactly like his and works fine. When it was like this:

_inventory = [

            getWeaponCargo _object,

            getMagazineCargo _object,

            getBackpackCargo _object

            /*ZSC*/

             _object getVariable["bankMoney",0]

            /*ZSC*/

        ];

 

 The inventories got wiped, when it was like this:

 

_inventory = [

            getWeaponCargo _object,

            getMagazineCargo _object,

            getBackpackCargo _object,

            /*ZSC*/

            , _object getVariable["bankMoney",0]

            /*ZSC*/

        ];

It would not even boot.

 

Once I noticed the comma and changed it to:

 

_inventory = [

            getWeaponCargo _object,

            getMagazineCargo _object,

            getBackpackCargo _object

            /*ZSC*/

            , _object getVariable["bankMoney",0]

            /*ZSC*/

        ];

Everything worked perfectly.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...