Seelenschnitter
New Member
Hi guys anybody got any idea how to reliaze that Weapons will spawn with more ammunition at heli crash and/or military?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
case "weapon": {
//Item is a weapon, add it and a random quantity of magazines
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
_item addWeaponCargoGlobal [_iItem,1];
_mags = [] + getArray (configFile >> "cfgWeapons" >> _iItem >> "magazines");
if (count _mags > 0) then {
_item addMagazineCargoGlobal [(_mags select 0),(round(random 3)+1)];
};
Working. How do i realize that all the SCAR weapons will spawn with ammunition too? There must be a variable where it call for the magazines am i right?
My SCAR weapons spawn with 0 or only 1 clips atm. The other weapons with
(round(random 1)+3)
Seems like this isn't working for the SCAR weapons
case "weapon": {
//Item is a weapon, add it and a random quantity of magazines
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
_item addWeaponCargoGlobal [_iItem,1];
_mags = [] + getArray (configFile >> "cfgWeapons" >> _iItem >> "magazines");
if ((count _mags) > 0) then {
if (_mags select 0 == "Quiver") then { _mags set [0, "WoodenArrow"] }; // Prevent spawning a Quiver
_item addMagazineCargoGlobal [(_mags select 0), (round(random 1)+2)];
};
};