Jump to content

Ammo boxes vanishing with new epoch... ReammoBox cleanup?


PetuniaEpoch

Recommended Posts

Hey guys,

 

We have an AI stronghold at Devils Castle, with some nice loot for those brave enough to take on the AI...

 

Unfortunately since the new update, the ammo boxes (apparently randomly!) vanish...

 

I'm 'pretty' sure it's relating to this cleanup script:

 

 
if (_noPlayerNear) then
{
_nearObj = nearestObjects [_objectPos,["ReammoBox","WeaponHolder","WeaponHolderBase"],((sizeOf (typeOf _x)) + 5)];
{
deleteVehicle _x;
_deletedLoot = _deletedLoot + 1;
} forEach _nearObj;
_x setVariable ["looted",-0.1,true];
};

 

Does anyone think that's right?

 

If it is, and if the code serves a function (I'm sure it does!), then would the best thing to do, be to assign the boxes I spawn at deviles with a variable, and then except them from the above if {} statement, in a similar way that Sarge AI and DZAI do?

 

Thanks in advance for ya help!

 

Mike.

Link to comment
Share on other sites

                    if (vehicle _x getVariable ["Sarge",0] != 1) then {
                        deleteVehicle _x;
                        _deletedLoot = _deletedLoot + 1;
                    };

Need to add variable to the crate i.e

 

_crate1 setVariable ["Sarge",1,true];

 

To remove the variable so crate despawns later during server cleanup

 

_crate1 setVariable ["Sarge",nil];

Link to comment
Share on other sites

Great, thanks :D

 

 

                    if (vehicle _x getVariable ["Sarge",0] != 1) then {
                        deleteVehicle _x;
                        _deletedLoot = _deletedLoot + 1;
                    };

Need to add variable to the crate i.e

 

_crate1 setVariable ["Sarge",1,true];

 

To remove the variable so crate despawns later during server cleanup

 

_crate1 setVariable ["Sarge",nil];

 

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...