Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Usage: [_crate,"type"] execVM "dir\DZMSC130Crate.sqf";
- _crate is the crate to fill
- "type" is the type of crate
- "type" can be weapons or medical
- */
- _crate = _this select 0;
- _type = _this select 1;
- // Clear the current cargo
- clearWeaponCargoGlobal _crate;
- clearMagazineCargoGlobal _crate;
- // Define lists. Some lists are defined in DZMSWeaponCrateList.sqf in the ExtConfig.
- _bpackList = ["DZ_ALICE_Pack_EP1","DZ_TK_Assault_Pack_EP1","DZ_British_ACU","DZ_CivilBackpack_EP1","DZ_Backpack_EP1","DZ_LargeGunBag_EP1"];
- _gshellList = ["HandGrenade_west","PipeBomb"];
- _medical = ["ItemMorphine","FoodSteakCooked","FoodMRE","ItemSodaRbull","ItemBloodbag"];
- _money = ["ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz"];
- //////////////////////////////////////////////////////////////////
- // Medical Crates
- if (_type == "medical") then {
- // load medical
- _scount = count _medical;
- for "_x" from 0 to 40 do {
- _sSelect = floor(random _sCount);
- _item = _medical select _sSelect;
- _crate addMagazineCargoGlobal [_item,(round(random 2))];
- };
- };
- ///////////////////////////////////////////////////////////////////
- // Weapon Crates
- if (_type == "weapons") then {
- // load grenades
- _scount = count _gshellList;
- for "_x" from 0 to 2 do {
- _sSelect = floor(random _sCount);
- _item = _gshellList select _sSelect;
- _crate addMagazineCargoGlobal [_item,(round(random 4))];
- };
- // load packs
- _scount = count _bpackList;
- for "_x" from 0 to 3 do {
- _sSelect = floor(random _sCount);
- _item = _bpackList select _sSelect;
- _crate addBackpackCargoGlobal [_item,1];
- };
- // load pistols
- _scount = count DZMSpistolList;
- for "_x" from 0 to 2 do {
- _sSelect = floor(random _sCount);
- _item = DZMSpistolList select _sSelect;
- _crate addWeaponCargoGlobal [_item,1];
- _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
- if (count _ammo > 0) then {
- _crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
- };
- };
- //load sniper
- _scount = count DZMSsniperList;
- for "_x" from 0 to 1 do {
- _sSelect = floor(random _sCount);
- _item = DZMSsniperList select _sSelect;
- _crate addWeaponCargoGlobal [_item,1];
- _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
- if (count _ammo > 0) then {
- _crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
- };
- };
- //load mg
- _scount = count DZMSmgList;
- for "_x" from 0 to 1 do {
- _sSelect = floor(random _sCount);
- _item = DZMSmgList select _sSelect;
- _crate addWeaponCargoGlobal [_item,1];
- _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
- if (count _ammo > 0) then {
- _crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
- };
- };
- //load primary
- _scount = count DZMSprimaryList;
- for "_x" from 0 to 2 do {
- _sSelect = floor(random _sCount);
- _item = DZMSprimaryList select _sSelect;
- _crate addWeaponCargoGlobal [_item,1];
- _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
- if (count _ammo > 0) then {
- _crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
- };
- };
- };
- ///////////////////////////////////////////////////////////////////
- // Epoch Supply Crates
- if (_type == "supply") then {
- // load tools
- _scount = count DZMSConTools;
- for "_x" from 0 to 2 do {
- _sSelect = floor(random _sCount);
- _item = DZMSConTools select _sSelect;
- _crate addWeaponCargoGlobal [_item, 1];
- };
- // load construction
- _scount = count DZMSConSupply;
- for "_x" from 0 to 30 do {
- _sSelect = floor(random _sCount);
- _item = DZMSConSupply select _sSelect;
- _crate addMagazineCargoGlobal [_item,1];
- };
- };
- ///////////////////////////////////////////////////////////////////
- // Epoch Money Crates
- if (_type == "money") then {
- // load money
- _scount = count _money;
- for "_x" from 0 to 3 do {
- _sSelect = floor(random _sCount);
- _item = _money select _sSelect;
- _crate addMagazineCargoGlobal [_item,1];
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement