Advertisement
Guest User

C130Crate - Edited Box

a guest
Jun 22nd, 2014
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.98 KB | None | 0 0
  1. /*
  2.     Usage: [_crate,"type"] execVM "dir\DZMSC130Crate.sqf";
  3.         _crate is the crate to fill
  4.         "type" is the type of crate
  5.         "type" can be weapons or medical
  6. */
  7. _crate = _this select 0;
  8. _type = _this select 1;
  9.  
  10. // Clear the current cargo
  11. clearWeaponCargoGlobal _crate;
  12. clearMagazineCargoGlobal _crate;
  13.  
  14. // Define lists. Some lists are defined in DZMSWeaponCrateList.sqf in the ExtConfig.
  15. _bpackList = ["DZ_ALICE_Pack_EP1","DZ_TK_Assault_Pack_EP1","DZ_British_ACU","DZ_CivilBackpack_EP1","DZ_Backpack_EP1","DZ_LargeGunBag_EP1"];
  16. _gshellList = ["HandGrenade_west","PipeBomb"];
  17. _medical = ["ItemMorphine","FoodSteakCooked","FoodMRE","ItemSodaRbull","ItemBloodbag"];
  18. _money = ["ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz"];
  19.  
  20. //////////////////////////////////////////////////////////////////
  21. // Medical Crates
  22. if (_type == "medical") then {
  23.     // load medical
  24.     _scount = count _medical;
  25.     for "_x" from 0 to 40 do {
  26.         _sSelect = floor(random _sCount);
  27.         _item = _medical select _sSelect;
  28.         _crate addMagazineCargoGlobal [_item,(round(random 2))];
  29.     };
  30. };
  31.  
  32. ///////////////////////////////////////////////////////////////////
  33. // Weapon Crates
  34. if (_type == "weapons") then {
  35.     // load grenades
  36.     _scount = count _gshellList;
  37.     for "_x" from 0 to 2 do {
  38.         _sSelect = floor(random _sCount);
  39.         _item = _gshellList select _sSelect;
  40.         _crate addMagazineCargoGlobal [_item,(round(random 4))];
  41.     };
  42.    
  43.     // load packs
  44.     _scount = count _bpackList;
  45.     for "_x" from 0 to 3 do {
  46.         _sSelect = floor(random _sCount);
  47.         _item = _bpackList select _sSelect;
  48.         _crate addBackpackCargoGlobal [_item,1];
  49.     };
  50.      
  51.     // load pistols
  52.     _scount = count DZMSpistolList;
  53.     for "_x" from 0 to 2 do {
  54.         _sSelect = floor(random _sCount);
  55.         _item = DZMSpistolList select _sSelect;
  56.         _crate addWeaponCargoGlobal [_item,1];
  57.         _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
  58.         if (count _ammo > 0) then {
  59.             _crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
  60.         };
  61.     };
  62.  
  63.     //load sniper
  64.     _scount = count DZMSsniperList;
  65.     for "_x" from 0 to 1 do {
  66.         _sSelect = floor(random _sCount);
  67.         _item = DZMSsniperList select _sSelect;
  68.         _crate addWeaponCargoGlobal [_item,1];
  69.         _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
  70.         if (count _ammo > 0) then {
  71.             _crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
  72.         };
  73.     };
  74.  
  75.     //load mg
  76.     _scount = count DZMSmgList;
  77.     for "_x" from 0 to 1 do {
  78.         _sSelect = floor(random _sCount);
  79.         _item = DZMSmgList select _sSelect;
  80.         _crate addWeaponCargoGlobal [_item,1];
  81.         _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
  82.         if (count _ammo > 0) then {
  83.             _crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
  84.         };
  85.     };
  86.  
  87.     //load primary
  88.     _scount = count DZMSprimaryList;
  89.     for "_x" from 0 to 2 do {
  90.         _sSelect = floor(random _sCount);
  91.         _item = DZMSprimaryList select _sSelect;
  92.         _crate addWeaponCargoGlobal [_item,1];
  93.         _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
  94.         if (count _ammo > 0) then {
  95.             _crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
  96.         };
  97.     };
  98. };
  99.  
  100. ///////////////////////////////////////////////////////////////////
  101. // Epoch Supply Crates
  102. if (_type == "supply") then {
  103.     // load tools
  104.     _scount = count DZMSConTools;
  105.     for "_x" from 0 to 2 do {
  106.         _sSelect = floor(random _sCount);
  107.         _item = DZMSConTools select _sSelect;
  108.         _crate addWeaponCargoGlobal [_item, 1];
  109.     };
  110.    
  111.     // load construction
  112.     _scount = count DZMSConSupply;
  113.     for "_x" from 0 to 30 do {
  114.         _sSelect = floor(random _sCount);
  115.         _item = DZMSConSupply select _sSelect;
  116.         _crate addMagazineCargoGlobal [_item,1];
  117.     };
  118. };
  119.  
  120. ///////////////////////////////////////////////////////////////////
  121. // Epoch Money Crates
  122. if (_type == "money") then {
  123.     // load money
  124.     _scount = count _money;
  125.     for "_x" from 0 to 3 do {
  126.         _sSelect = floor(random _sCount);
  127.         _item = _money select _sSelect;
  128.         _crate addMagazineCargoGlobal [_item,1];
  129.     };
  130. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement