Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Usage: [_crate,"type"] execVM "dir\DZMSBox.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_GunBag_EP1","DZ_LargeGunBag_EP1"];
- _gshellList = ["HandGrenade_west","FlareGreen_M203","1Rnd_HE_M203"];
- _medical = ["ItemBandage","ItemMorphine","ItemPainkiller","ItemAntibiotic","ItemBloodbag"];
- _money = ["ItemGoldBar","ItemGoldBar10oz"];
- _food = ["FoodMRE","ItemWaterbottle","ItemSodaPepsi","ItemSodaCoke","FoodCanBakedBeans","FoodCanFrankBeans"];
- _rare = ["ItemBriefcase100oz","PipeBomb","ItemORP","ItemAVE","ItemLRK","ItemTNK"];
- _documents = ["ItemDocument"];
- _bulk = ["bulk_itemSodaCokeFull","bulk_itemSodaPepsiFull","bulk_FoodBaconCookedFull","bulk_17Rnd_9x19_glock17","bulk_15Rnd_9x19_M9SD","bulk_30Rnd_9x19_MP5SD","bulk_30Rnd_556x45_StanagSD","bulk_itemSandbag","bulk_itemTankTrap","bulk_itemWire","bulk_partGeneric"];
- //////////////////////////////////////////////////////////////////
- // Medical Crates
- if (_type == "medical") then {
- // load medical
- _scount = count _medical;
- for "_x" from 0 to 20 do {
- _sSelect = floor(random _sCount);
- _item = _medical select _sSelect;
- _crate addMagazineCargoGlobal [_item,(round(random 4))];
- };
- };
- ///////////////////////////////////////////////////////////////////
- // Food crate
- if (_type == "food") then {
- //load food
- _scount = count _food;
- for "_x" from 0 to 20 do {
- _sSelect = floor(random _sCount);
- _item = _food select _sSelect;
- _crate addMagazineCargoGlobal [_item,(round(random 4))];
- };
- };
- ///////////////////////////////////////////////////////////////////
- // Weapon Crates
- // Low weapons
- if (_type == "weaponsL") 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 2))];
- };
- // 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 4 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 3 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 lmg
- _scount = count DZMSlmgList;
- for "_x" from 0 to 3 do {
- _sSelect = floor(random _sCount);
- _item = DZMSlmgList 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 smg
- _scount = count DZMSsmgList;
- for "_x" from 0 to 5 do {
- _sSelect = floor(random _sCount);
- _item = DZMSsmgList 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 shotguns
- _scount = count DZMSShotgunList;
- for "_x" from 0 to 5 do {
- _sSelect = floor(random _sCount);
- _item = DZMSShotgunList 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 10 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))];
- };
- };
- };
- // Medium weapons
- if (_type == "weaponsM") then {
- // load grenades
- _scount = count _gshellList;
- for "_x" from 0 to 5 do {
- _sSelect = floor(random _sCount);
- _item = _gshellList select _sSelect;
- _crate addMagazineCargoGlobal [_item,(round(random 2))];
- };
- // load packs
- _scount = count _bpackList;
- for "_x" from 0 to 5 do {
- _sSelect = floor(random _sCount);
- _item = _bpackList select _sSelect;
- _crate addBackpackCargoGlobal [_item,1];
- };
- // load pistols
- _scount = count DZMSpistolList;
- for "_x" from 0 to 6 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 5 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 lmg
- _scount = count DZMSlmgList;
- for "_x" from 0 to 5 do {
- _sSelect = floor(random _sCount);
- _item = DZMSlmgList 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 high cal
- _scount = count DZMSHighCalSniperList;
- for "_x" from 0 to 2 do {
- _sSelect = floor(random _sCount);
- _item = DZMSHighCalSniperList 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 20 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))];
- };
- };
- };
- // High weapons
- if (_type == "weaponsH") then {
- // load grenades
- _scount = count _gshellList;
- for "_x" from 0 to 10 do {
- _sSelect = floor(random _sCount);
- _item = _gshellList select _sSelect;
- _crate addMagazineCargoGlobal [_item,(round(random 2))];
- };
- // load packs
- _scount = count _bpackList;
- for "_x" from 0 to 10 do {
- _sSelect = floor(random _sCount);
- _item = _bpackList select _sSelect;
- _crate addBackpackCargoGlobal [_item,1];
- };
- //load sniper
- _scount = count DZMSsniperList;
- for "_x" from 0 to 10 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 lmg
- _scount = count DZMSlmgList;
- for "_x" from 0 to 10 do {
- _sSelect = floor(random _sCount);
- _item = DZMSlmgList 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 high cal
- _scount = count DZMSHighCalSniperList;
- for "_x" from 0 to 5 do {
- _sSelect = floor(random _sCount);
- _item = DZMSHighCalSniperList 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 thermals
- _scount = count DZMSThermalList;
- for "_x" from 0 to 1 do {
- _sSelect = floor(random _sCount);
- _item = DZMSThermalList 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 explosive
- _scount = count DZMSExpWeapList;
- for "_x" from 0 to 2 do {
- _sSelect = floor(random _sCount);
- _item = DZMSExpWeapList 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 30 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
- //low supplies
- if (_type == "supplyL") 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 supplies
- _scount = count DZMSConSupply;
- for "_x" from 0 to 15 do {
- _sSelect = floor(random _sCount);
- _item = DZMSConSupply select _sSelect;
- _crate addMagazineCargoGlobal [_item,(round(random 2))];
- };
- // load structures
- _scount = count DZMSConStructures;
- for "_x" from 0 to 10 do {
- _sSelect = floor(random _sCount);
- _item = DZMSConStructures select _sSelect;
- _crate addMagazineCargoGlobal [_item,(round(random 2))];
- };
- // load bulk
- _scount = count _bulk;
- for "_x" from 0 to 5 do {
- _sSelect = floor(random _sCount);
- _item = _bulk select _sSelect;
- _crate addMagazineCargoGlobal [_item,(round(random 2))];
- };
- // load money
- _scount = count _money;
- for "_x" from 0 to 10 do {
- _sSelect = floor(random _sCount);
- _item = _money select _sSelect;
- _crate addMagazineCargoGlobal [_item,(round(random 2))];
- };
- };
- //medium supplies
- if (_type == "supplyM") then {
- // load tools
- _scount = count DZMSConTools;
- for "_x" from 0 to 5 do {
- _sSelect = floor(random _sCount);
- _item = DZMSConTools select _sSelect;
- _crate addWeaponCargoGlobal [_item, 1];
- };
- // load supplies
- _scount = count DZMSConSupply;
- for "_x" from 0 to 20 do {
- _sSelect = floor(random _sCount);
- _item = DZMSConSupply select _sSelect;
- _crate addMagazineCargoGlobal [_item,(round(random 2))];
- };
- // load structures
- _scount = count DZMSConStructures;
- for "_x" from 0 to 15 do {
- _sSelect = floor(random _sCount);
- _item = DZMSConStructures select _sSelect;
- _crate addMagazineCargoGlobal [_item,(round(random 2))];
- };
- // load bulk
- _scount = count _bulk;
- for "_x" from 0 to 10 do {
- _sSelect = floor(random _sCount);
- _item = _bulk select _sSelect;
- _crate addMagazineCargoGlobal [_item,(round(random 2))];
- };
- // load money
- _scount = count _money;
- for "_x" from 0 to 15 do {
- _sSelect = floor(random _sCount);
- _item = _money select _sSelect;
- _crate addMagazineCargoGlobal [_item,(round(random 2))];
- };
- // load rare
- _scount = count _rare;
- for "_x" from 0 to 2 do {
- _sSelect = floor(random _sCount);
- _item = _rare select _sSelect;
- _crate addMagazineCargoGlobal [_item,1];
- };
- };
- //high supplies
- if (_type == "supplyH") then {
- // load tools
- _scount = count DZMSConTools;
- for "_x" from 0 to 10 do {
- _sSelect = floor(random _sCount);
- _item = DZMSConTools select _sSelect;
- _crate addWeaponCargoGlobal [_item, 1];
- };
- // load supplies
- _scount = count DZMSConSupply;
- for "_x" from 0 to 40 do {
- _sSelect = floor(random _sCount);
- _item = DZMSConSupply select _sSelect;
- _crate addMagazineCargoGlobal [_item,(round(random 2))];
- };
- // load structures
- _scount = count DZMSConStructures;
- for "_x" from 0 to 30 do {
- _sSelect = floor(random _sCount);
- _item = DZMSConStructures select _sSelect;
- _crate addMagazineCargoGlobal [_item,(round(random 2))];
- };
- // load bulk
- _scount = count _bulk;
- for "_x" from 0 to 20 do {
- _sSelect = floor(random _sCount);
- _item = _bulk select _sSelect;
- _crate addMagazineCargoGlobal [_item,(round(random 2))];
- };
- // load money
- _scount = count _money;
- for "_x" from 0 to 20 do {
- _sSelect = floor(random _sCount);
- _item = _money select _sSelect;
- _crate addMagazineCargoGlobal [_item,(round(random 2))];
- };
- // load rare
- _scount = count _rare;
- for "_x" from 0 to 5 do {
- _sSelect = floor(random _sCount);
- _item = _rare select _sSelect;
- _crate addMagazineCargoGlobal [_item,1];
- };
- };
- ///////////////////////////////////////////////////////////////////
- // Epoch Money Crates
- if (_type == "money") then {
- // load money
- _scount = count _money;
- for "_x" from 0 to 30 do {
- _sSelect = floor(random _sCount);
- _item = _money select _sSelect;
- _crate addMagazineCargoGlobal [_item,(round(random 2))];
- };
- // load rare
- _scount = count _money;
- for "_x" from 0 to 5 do {
- _sSelect = floor(random _sCount);
- _item = _money select _sSelect;
- _crate addMagazineCargoGlobal [_item,1];
- };
- // load documents
- _scount = count _money;
- for "_x" from 0 to 10 do {
- _sSelect = floor(random _sCount);
- _item = _money select _sSelect;
- _crate addMagazineCargoGlobal [_item,4];
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement