Guest User

Untitled

a guest
Feb 13th, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.12 KB | None | 0 0
  1. /*
  2. Usage: [_crate,"type"] execVM "dir\DZMSBox.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_Patrol_Pack_EP1","DZ_Assault_Pack_EP1","DZ_Czech_Vest_Puch","DZ_ALICE_Pack_EP1","DZ_TK_Assault_Pack_EP1","DZ_British_ACU","DZ_CivilBackpack_EP1","DZ_Backpack_EP1"];
  16. _gshellList = ["HandGrenade_west","FlareGreen_M203","FlareWhite_M203"];
  17. _medical = ["ItemBandage","ItemMorphine","ItemEpinephrine","ItemPainkiller","ItemWaterbottle","FoodMRE","ItemAntibiotic","ItemBloodbag"];
  18. _tools = [];
  19.  
  20. //////////////////////////////////////////////////////////////////
  21. // Medical Crates
  22. if (_type == "medical") then {
  23. // load medical
  24. _scount = count _medical;
  25. for "_x" from 0 to 16 do {
  26. _sSelect = floor(random _sCount);
  27. _item = _medical select _sSelect;
  28. _crate addMagazineCargoGlobal [_item,(round(random 2))];
  29. };
  30.  
  31. // load tools
  32. _scount = count _tools;
  33. for "_x" from 0 to 2 do {
  34. _sSelect = floor(random _sCount);
  35. _item = _medical select _sSelect;
  36. _crate addMagazineCargoGlobal [_item,1];
  37. };
  38. };
  39.  
  40. ///////////////////////////////////////////////////////////////////
  41. // Weapon Crates
  42. if (_type == "weapons") then {
  43. // load grenades
  44. _scount = count _gshellList;
  45. for "_x" from 0 to 2 do {
  46. _sSelect = floor(random _sCount);
  47. _item = _gshellList select _sSelect;
  48. _crate addMagazineCargoGlobal [_item,(round(random 2))];
  49. };
  50.  
  51. // load packs
  52. _scount = count _bpackList;
  53. for "_x" from 0 to 3 do {
  54. _sSelect = floor(random _sCount);
  55. _item = _bpackList select _sSelect;
  56. _crate addBackpackCargoGlobal [_item,1];
  57. };
  58.  
  59. // load pistols
  60. _scount = count DZMSpistolList;
  61. for "_x" from 0 to 2 do {
  62. _sSelect = floor(random _sCount);
  63. _item = DZMSpistolList select _sSelect;
  64. _crate addWeaponCargoGlobal [_item,1];
  65. _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
  66. if (count _ammo > 0) then {
  67. _crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
  68. };
  69. };
  70.  
  71. //load sniper
  72. _scount = count DZMSsniperList;
  73. for "_x" from 0 to 1 do {
  74. _sSelect = floor(random _sCount);
  75. _item = DZMSsniperList select _sSelect;
  76. _crate addWeaponCargoGlobal [_item,1];
  77. _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
  78. if (count _ammo > 0) then {
  79. _crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
  80. };
  81. };
  82.  
  83. //load mg
  84. _scount = count DZMSmgList;
  85. for "_x" from 0 to 2 do {
  86. _sSelect = floor(random _sCount);
  87. _item = DZMSmgList select _sSelect;
  88. _crate addWeaponCargoGlobal [_item,1];
  89. _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
  90. if (count _ammo > 0) then {
  91. _crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
  92. };
  93. };
  94.  
  95. //load primary
  96. _scount = count DZMSprimaryList;
  97. for "_x" from 0 to 3 do {
  98. _sSelect = floor(random _sCount);
  99. _item = DZMSprimaryList select _sSelect;
  100. _crate addWeaponCargoGlobal [_item,1];
  101. _ammo = [] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
  102. if (count _ammo > 0) then {
  103. _crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
  104. };
  105. };
  106.  
  107. // load tools
  108. _scount = count _tools;
  109. for "_x" from 0 to 2 do {
  110. _sSelect = floor(random _sCount);
  111. _item = _medical select _sSelect;
  112. _crate addMagazineCargoGlobal [_item,1];
  113. };
  114. };
  115.  
  116. ///////////////////////////////////////////////////////////////////
  117. // Epoch Supply Crates
  118. if (_type == "supply") then {
  119. // load tools
  120. _scount = count DZMSConTools;
  121. for "_x" from 0 to 2 do {
  122. _sSelect = floor(random _sCount);
  123. _item = DZMSConTools select _sSelect;
  124. _crate addWeaponCargoGlobal [_item, 1];
  125. };
  126.  
  127. // load construction
  128. _scount = count DZMSConSupply;
  129. for "_x" from 0 to 12 do {
  130. _sSelect = floor(random _sCount);
  131. _item = DZMSConSupply select _sSelect;
  132. _crate addMagazineCargoGlobal [_item,(round(random 2))];
  133. };
  134. };
Advertisement
Add Comment
Please, Sign In to add comment