Advertisement
Hellstorm77

Ammo box

Apr 24th, 2013
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.10 KB | None | 0 0
  1.  
  2. _marker = "local_box"; // marker used to spawn.
  3. _boxType = "B_supplyCrate_F"; // the type of ammobox used.
  4. _timer = 600; // time in seconds until box is refilled.
  5.  
  6. if (_this != player) exitWith {}; // exit all other clients.
  7. _weapons = []; _magazines = [];
  8.  
  9. // load available to standard players only.
  10. if (_this in [player1,player2,player3,player4]) then {
  11. _weapons =
  12. [
  13. ["arifle_MX_F",50],
  14. ["arifle_MXC_F",50],
  15. ["arifle_TRG20_F",50],
  16. ["arifle_TRG21_F",50],
  17. ["srifle_EBR_F",50],
  18. ["arifle_Khaybar_F",50],
  19. ["arifle_Khaybar_C_F",50],
  20. ["hgun_rook40_F",50],
  21. ["hgun_P07_F",50],
  22. ["ToolKit",50],
  23. ["MediKit",50],
  24. ["MineDetector",50],
  25. ["arifle_MXM_F",50] // notice that there is no , at the end of the last weapon.
  26. ];
  27.  
  28. _magazines =
  29. [
  30. ["30Rnd_65x39_Caseless_mag",100],
  31. ["100Rnd_65x39_Caseless_mag",100],
  32. ["30Rnd_65x39_caseless_mag_Tracer",100],
  33. ["30Rnd_65x39_case_mag",100],
  34. ["16Rnd_9x21_Mag",100],
  35. ["30Rnd_9x21_Mag",100],
  36. ["20Rnd_556x45_UW_Mag",100],
  37. ["30RND_556x45_Stanag",100],
  38. ["20Rnd_762x45_Mag",10] // notice that there is no , at the end of the last magazine.
  39.  
  40. ];
  41. };
  42.  
  43. // COPY FROM HERE
  44.  
  45. // load available to clan members only.
  46. if (_this in [clan1,clan2]) then {
  47. _weapons =
  48. [
  49. ["arifle_MX_F",1],
  50. ["arifle_MXM_F",1] // notice that there is no , at the end of the last weapon.
  51. ];
  52.  
  53. _magazines =
  54. [
  55. ["20Rnd_762x45_Mag",10] // notice that there is no , at the end of the last magazine.
  56.  
  57. ];
  58. };
  59.  
  60. // TO HERE FOR AN ADDITIONAL GROUP
  61. if (_this in [mg1,mg2,mg3,mg4,mg5,mg6,mg64]) then {
  62. _weapons =
  63. [
  64. ["LMG_Mk200_F",10] // notice that there is no , at the end of the last weapon.
  65. ];
  66.  
  67. _magazines =
  68. [
  69. ["200Rnd_65x39_cased_Box",50], // notice that there is no , at the end of the last magazine.
  70. ["200RND_65x39_Cased_box_Tracer",50]
  71. ];
  72. };
  73.  
  74. if (_this in [gl1,gl2,gl3,gl4,gl5,gl6]) then {
  75. _weapons =
  76. [
  77. ["arifle_MX_GL_F",10],
  78. ["arifle_TRG21_GL_F",10], // notice that there is no , at the end of the last weapon.
  79. ["arifle_Khaybar_GL_F",10]
  80. ];
  81.  
  82. _magazines =
  83. [
  84. ["1Rnd_HE_Grenade_shell",50], // notice that there is no , at the end of the last magazine.
  85. ["1Rnd_Smoke_Grenade_shell",50],
  86. ["1Rnd_SmokeBlue_Grenade_shell",50],
  87. ["1Rnd_SmokeGreen_Grenade_shell",50,
  88. ["1Rnd_SmokeOrange_Grenade_shell",50],
  89. ["1Rnd_SmokePurple_Grenade_shell",50],
  90. ["1Rnd_SmokeRed_Grenade_shell",50],
  91. ["1Rnd_SmokeYellow_Grenade_shell",50],
  92. ["UGL_FlareCIR_F",50],
  93. ["UGL_FlareWhite_F",50]
  94. ];
  95. };
  96.  
  97. if (_this in [at1,at2,at3,at4,at5,at6]) then {
  98. _weapons =
  99. [
  100. ["launch_NLAW_F",1],
  101. ["launch_RPG32_F",1]
  102. ];
  103.  
  104. _magazines =
  105. [
  106. ["RPG32_F",50],
  107. ["NLAW_F",50]
  108. ];
  109. };
  110. // create and fill the box.
  111. _box = _boxType createVehicleLocal (getMarkerPos _marker);
  112. _box allowDamage false;
  113.  
  114. while {true} do {
  115. // empty it.
  116. clearWeaponCargo _box;
  117. clearMagazineCargo _box;
  118.  
  119. // add in all weapons.
  120. {_box addWeaponCargo [(_x select 0),(_x select 1)]} foreach _weapons;
  121.  
  122. // add in all magazines.
  123. {_box addMagazineCargo [(_x select 0),(_x select 1)]} foreach _magazines;
  124.  
  125. // wait x amount of seconds then refill box.
  126. sleep _timer;
  127. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement