Editing loot in mission spawned vehicles

HospitalChair

Well-Known Member
I have customized my server with more vehicles and have noticed that some spawn with their own loot and some spawn with no loot. I was wondering if it was possible to edit the loot in these mission spawned vehicles. And of course, how?
 
Some vehicles from arma are designed to start with certain gear in them, which for arma is fine, but of course that's different with DayZ.

All you need to do is clear the cargo after the script spawns it in.
Use clearWeaponCargoGlobal and clearMagazineCargoGlobal.
 
If i use that, will it remove the weapons and ammo inside the custom ammo crates ive placed as well. I'm also trying to figure out how to insert my own loot into the vehicles.
 
You would use those to clear the default cargo, and then use addWeaponCargoGlobal and addMagazineCargoGlobal to add what you wanted right after you empty the default cargo.

Like this:
Code:
_crate = _this select 0;
clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;

_crate addMagazineCargoGlobal ["HandGrenade", 2];
_crate addMagazineCargoGlobal ["HandGrenade_west", 8];
_crate addMagazineCargoGlobal ["HandRoadFlare", 8];
_crate addMagazineCargoGlobal ["PipeBomb", 1];
 
If you have multiple vehicles and want to add custom cargo to each, you'll have to clear each and add the items to each, like this:

Code:
_hummer = createVehicle ["UAZ_INS",[(_coords select 0) + 10, (_coords select 1) - 20,0],[], 0, "CAN_COLLIDE"];
_hummer1 = createVehicle ["UAZ_INS",[(_coords select 0) + 20, (_coords select 1) - 10,0],[], 0, "CAN_COLLIDE"];

clearWeaponCargoGlobal _hummer;
clearWeaponCargoGlobal _hummer1;
clearMagazineCargoGlobal _hummer;
clearMagazineCargoGlobal _hummer1;

_hummer addMagazineCargoGlobal ["PipeBomb", 1];
_hummer1 addMagazineCargoGlobal ["PipeBomb", 1];

You could use a ForEach to add an array of items to them but i'm not sure what the exact code would look like, something like:
Code:
{
    _vehicle addWeaponCargoGlobal _x;
} forEach ["M16","KSVK","M60"];
 
Back
Top