Jump to content

Ammo Boxes (Placed In The Editor) Getting Deleted After (Roughly) 30 minutes?


DY357LX

Recommended Posts

We've added a new camp to the North-West Airfield containing the standard stuff, tents, wrecks, ammo boxes and AI to protect the goodies.

However, we've noticed that after roughly 30 minutes the boxes become empty.

 

Does anyone have any idea why?

We're thinking the server cleanup might be to blame. Possibly one of the AI mods running (WAI, EMS + Sarge) is doing a cleanup too.

 

Any suggestions? Thanks.

Link to comment
Share on other sites

This is my current Construction box. 

_box = _this select 0;

_box setVariable ["ObjectID","1",true];
_box setVariable ["permaLoot",true];
PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_box];

clearWeaponCargoGlobal _box;
clearMagazineCargoGlobal _box;

// CONSTRUCTION MATERIALS
_box addMagazineCargoGlobal ["bulk_empty", 25];
_box addMagazineCargoGlobal ["CinderBlocks", 50];
_box addMagazineCargoGlobal ["MortarBucket", 25];
_box addMagazineCargoGlobal ["PartPlywoodPack", 10];
_box addMagazineCargoGlobal ["ItemCanvas", 25];
_box addMagazineCargoGlobal ["PartGeneric", 25];
_box addMagazineCargoGlobal ["ItemSandbag", 15];
_box addMagazineCargoGlobal ["ItemTankTrap", 15];
_box addMagazineCargoGlobal ["PartWoodPile", 20];
_box addMagazineCargoGlobal ["ItemComboLock", 2];

// TOOLS
_box addWeaponCargoGlobal ["ItemToolbox", 2];
_box addWeaponCargoGlobal ["ItemEtool", 2];
_box addWeaponCargoGlobal ["ItemCrowbar", 2];
_box addWeaponCargoGlobal ["ItemKnife", 2];

The code you want to add to yours is:

_box setVariable ["ObjectID","1",true];
_box setVariable ["permaLoot",true];
PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_box];

Bearing in mind you keep the same formatting as I do. e.g. _box

 

what this is doing is setting the box to be permanent loot excluding it from the clean-up. This will stay throughout the whole server. Never cleaned up.

 

Useful for AI bases... 

Link to comment
Share on other sites

Hmmm, so the files in the .sqf have code that looks like this:
 

_vehicle_508 = objNull;
if (true) then
{
  _this = createVehicle ["USSpecialWeaponsBox", [4495.4077, 10508.837, -3.0517578e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_508 = _this;
  _this setDir -300.15097;
  _this setPos [4495.4077, 10508.837, -3.0517578e-005];
};

If I were to add something like:

_vehicle_508 setVariable ["permaLoot",true];

Under the setPos code... would that help?

Link to comment
Share on other sites

You don't want them as vehicles, try the following code instead :)

_bldObj = objNull;
if (true) then
{
_bldObj = createVehicle ["USSpecialWeaponsBox", [4495.4077, 10508.837, -3.0517578e-005], [], 0, "CAN_COLLIDE"];
_bldObj setDir -300.15097;
_bldObj setPos [4495.4077, 10508.837, -3.0517578e-005];
_bldObj setVariable ["permaLoot",true];
};

You can also specify your own loot if you want ?

 

First clear out the default weapons that are added depending on the crate type.

 

clearWeaponCargoGlobal _bldObj;
clearMagazineCargoGlobal _bldObj;

 

Then add your weapons and ammo like this

_bldObj addWeaponCargoGlobal ["DMR",1];
_bldObj addMagazineCargoGlobal ["20Rnd_762x51_DMR",5];

 

You can change that code to add any weapon and ammo, just notice there is add weapon and add magazine, the numbers after are how many of each item will be in the crate, my example is 1 x DMR and 5 DMR mags, put it all together and you have this :)

 

_bldObj = objNull;
if (true) then
{
_bldObj = createVehicle ["USSpecialWeaponsBox", [4495.4077, 10508.837, -3.0517578e-005], [], 0, "CAN_COLLIDE"];
_bldObj setDir -300.15097;
_bldObj setPos [4495.4077, 10508.837, -3.0517578e-005];
clearWeaponCargoGlobal _bldObj;
clearMagazineCargoGlobal _bldObj;
_bldObj addWeaponCargoGlobal ["DMR",1];
_bldObj addMagazineCargoGlobal ["20Rnd_762x51_DMR",5];
_bldObj setVariable ["permaLoot",true];
};
Link to comment
Share on other sites

For easy of changing whats in them or to easily remove them use this instead. 

 

For calling the crates you simply add this to your init file at the bottom. 

[] execVM "Scripts\crates.sqf";

This way you can easily add and remove the crates just by commenting out the file like this. 

//[] execVM "Scripts\crates.sqf";

Here is the complete file used for the Sector FNG AI base addition. 

if (isServer) then {

//Williams Crates Weapons Crate
_vehicle_103769 = objNull;
if (true) then
{
  _this = createVehicle ["TKVehicleBox_EP1", [6660.3984, 14177.261], [], 0, "CAN_COLLIDE"];
  _vehicle_103769 = _this;
  _this setDir -182.5;
  _vehicle_103769 setVariable ["ObjectID","1",true];
  _vehicle_103769 setVariable ["permaLoot",true];
    //Clear Cargo
  clearweaponcargoGlobal _this;
  clearmagazinecargoGlobal _this;
  //Add Cargo
  _this addWeaponCargoGlobal ["M9SD",2];
  _this addWeaponCargoGlobal ["DMR_DZ",2];
  _this addWeaponCargoGlobal ["M4A1_AIM_SD_camo",2];
  _this addWeaponCargoGlobal ["M4A1_HWS_GL",2];
  _this addWeaponCargoGlobal ["M249_DZ",2];
  _this addWeaponCargoGlobal ["M14_EP1",2];
  _this addWeaponCargoGlobal ["Mk_48_DZ",2];
  _this addWeaponCargoGlobal ["M110_TWS_EP1",2];
  _this addWeaponCargoGlobal ["M4A3_CCO_EP1",2];
  _this addWeaponCargoGlobal ["revolver_gold_EP1",2];
  _this addWeaponCargoGlobal ["NVGoggles",3];
  _this addWeaponCargoGlobal ["Binocular_Vector",3];
  _this addWeaponCargoGlobal ["ItemGPS",3];

  _this addmagazineCargoGlobal ["20Rnd_762x51_DMR",20];
  _this addmagazineCargoGlobal ["30Rnd_556x45_StanagSD",20];
  _this addmagazineCargoGlobal ["200Rnd_556x45_M249",10];
  _this addmagazineCargoGlobal ["30Rnd_556x45_Stanag",40];
  _this addmagazineCargoGlobal ["15Rnd_9x19_M9SD",15];
  _this addmagazineCargoGlobal ["6Rnd_45ACP",15];
  _this addmagazineCargoGlobal ["1Rnd_HE_M203",5];
  _this addmagazineCargoGlobal ["PipeBomb",2];
  _this addmagazineCargoGlobal ["HandGrenade_West",3];

  _this addbackpackCargoGlobal ["DZ_largeGunBag_EP1",2];
  _this setPos [6660.3984, 14177.261];
};
//Williams Crates Vehicle Part Crate
_vehicle_103770 = objNull;
if (true) then
{
  _this = createVehicle ["TKVehicleBox_EP1", [6786.0361, 14320.882], [], 0, "CAN_COLLIDE"];
  _vehicle_103770 = _this;
  _vehicle_103770 setVariable ["ObjectID","1",true];
  _vehicle_103770 setVariable ["permaLoot",true];
    //Clear Cargo
  clearweaponcargoGlobal _this;
  clearmagazinecargoGlobal _this;
  //Add Cargo
  _this addWeaponCargoGlobal ["ItemToolbox",5];

  _this addmagazineCargoGlobal ["PartEngine",15];
  _this addmagazineCargoGlobal ["PartGeneric",15];
  _this addmagazineCargoGlobal ["PartVRotor",5];
  _this addmagazineCargoGlobal ["PartWheel",20];
  _this addmagazineCargoGlobal ["PartFueltank",15];
  _this addmagazineCargoGlobal ["PartGlass",30];
  _this addmagazineCargoGlobal ["ItemJerrycan",20];

  _this addbackpackCargoGlobal ["DZ_largeGunBag_EP1",2];
  _this setPos [6786.0361, 14320.882];
};
//Williams Crates Food and Drink Crate
_vehicle_103771 = objNull;
if (true) then
{
  _this = createVehicle ["TKVehicleBox_EP1", [6791.7695, 14091.711], [], 0, "CAN_COLLIDE"];
  _vehicle_103771 = _this;
  _this setDir -178.83;
  _vehicle_103771 setVariable ["ObjectID","1",true];
  _vehicle_103771 setVariable ["permaLoot",true];
  //Clear Cargo
  clearweaponcargoGlobal _this;
  clearmagazinecargoGlobal _this;
  //Add Cargo

  _this addmagazineCargoGlobal ["FoodCanBadguy",10];
  _this addmagazineCargoGlobal ["FoodCanBoneboy",10];
  _this addmagazineCargoGlobal ["FoodCanCorn",10];
  _this addmagazineCargoGlobal ["FoodCanCurgon",10];
  _this addmagazineCargoGlobal ["FoodCanDemon",10];
  _this addmagazineCargoGlobal ["FoodCanFraggleos",10];
  _this addmagazineCargoGlobal ["FoodCanHerpy",10];
  _this addmagazineCargoGlobal ["FoodCanDerpy",10];
  _this addmagazineCargoGlobal ["FoodCanTylers",10];
  _this addmagazineCargoGlobal ["ItemSodaMtngreen",10];
  _this addmagazineCargoGlobal ["ItemSodaR4z0r",10];
  _this addmagazineCargoGlobal ["ItemSodaClays",10];
  _this addmagazineCargoGlobal ["ItemSodaSmasht",10];
  _this addmagazineCargoGlobal ["ItemSodaDrwaste",10];
  _this addmagazineCargoGlobal ["ItemSodaLemonade",10];
  _this addmagazineCargoGlobal ["ItemSodaLvg",10];
  _this addmagazineCargoGlobal ["ItemSodaMzly",10];
  _this addmagazineCargoGlobal ["ItemSodaRabbit",10];

  _this addbackpackCargoGlobal ["DZ_largeGunBag_EP1",2];
  _this setPos [6791.7695, 14091.711];
};
//Williams Crates Medical Crate
_vehicle_103772 = objNull;
if (true) then
{
  _this = createVehicle ["TKVehicleBox_EP1", [6591.8535, 14275.836], [], 0, "CAN_COLLIDE"];
  _vehicle_103772 = _this;
  _vehicle_103772 setVariable ["ObjectID","1",true];
  _vehicle_103772 setVariable ["permaLoot",true];
  _this setDir 90.560677;
  //Clear Cargo
  clearweaponcargoGlobal _this;
  clearmagazinecargoGlobal _this;
  //Add Cargo
  _this addWeaponCargoGlobal ["NVGoggles",1];
  _this addWeaponCargoGlobal ["ItemGPS",1];

  _this addmagazineCargoGlobal ["ItemBandage",30];
  _this addmagazineCargoGlobal ["ItemPainkiller",30];
  _this addmagazineCargoGlobal ["ItemMorphine",30];
  _this addmagazineCargoGlobal ["ItemBloodBag",30];
  _this addmagazineCargoGlobal ["ItemEpinephrine",15];
  _this addmagazineCargoGlobal ["ItemAntibiotic",30];

  _this addbackpackCargoGlobal ["DZ_largeGunBag_EP1",2];
  _this setPos [6591.8535, 14275.836];
};
//Williams Crates BaseBuilding Crate
_vehicle_103773 = objNull;
if (true) then
{
  _this = createVehicle ["TKVehicleBox_EP1", [6668.1357, 14121.218], [], 0, "CAN_COLLIDE"];
  _vehicle_103773 = _this;
  _vehicle_103773 setVariable ["ObjectID","1",true];
  _vehicle_103773 setVariable ["permaLoot",true];
  //Clear Cargo
  clearweaponcargoGlobal _this;
  clearmagazinecargoGlobal _this;
  //Add Cargo
  _this addWeaponCargoGlobal ["ItemEtool",5];
  _this addWeaponCargoGlobal ["ItemToolbox",5];
  _this addWeaponCargoGlobal ["NVGoggles",1];
  _this addWeaponCargoGlobal ["ItemGPS",1];

  _this addmagazineCargoGlobal ["bulk_ItemSandbag",3];
  _this addmagazineCargoGlobal ["bulk_ItemTankTrap",2];
  _this addmagazineCargoGlobal ["bulk_ItemWire",2];
  _this addmagazineCargoGlobal ["ItemTent",5];
  _this addmagazineCargoGlobal ["bulk_PartGeneric",2];
  _this addmagazineCargoGlobal ["TrapBear",10];
  _this addmagazineCargoGlobal ["CinderBlocks",10];
  _this addmagazineCargoGlobal ["MotarBucket",10];
  _this addmagazineCargoGlobal ["ItemFuelPump",3];
  _this addmagazineCargoGlobal ["ItemVault",2];
  _this addmagazineCargoGlobal ["ItemComboLock",5];
  _this addmagazineCargoGlobal ["30m_plot-kit",2];

  _this addbackpackCargoGlobal ["DZ_largeGunBag_EP1",2];
  _this setPos [6668.1357, 14121.218];
};
};

 

This can be edited to your liking also the placement can be changed too. 

 

These boxes will stay through out the whole server time. No cleaning up of these. 

 

Let me know the results!

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...