Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 2.21 KB | None | 0 0
  1. //Random gear lists
  2. _uniforms = [""];
  3.  
  4. _vests = [""];
  5.  
  6. _helmets = [""];
  7.  
  8. _goggles = [""];
  9.  
  10. _backpacks = [""];
  11.  
  12. _genericUnits = [""];
  13.  
  14. _typesofUnit = toLower (_this select 0);
  15. _unit = _this select 1;
  16.  
  17. removeBackpack _unit;
  18. removeAllWeapons _unit;
  19. removeAllItemsWithMagazines _unit;
  20. removeAllAssignedItems _unit;
  21.  
  22. switch (_typeofUnit) do
  23. {  
  24.     //Copy paste the case below and add the units you need here
  25.     case "r": {
  26.     //ARSENAL CODE HERE
  27.     };
  28.  
  29.     //Note that these crates are empty, the insides of the crates are generated dynamically from the items/ammo  that the units above have
  30.     case "crate_small": {
  31.     clearWeaponCargoGlobal _unit;
  32.     clearMagazineCargoGlobal _unit;
  33.     clearItemCargoGlobal _unit;
  34.     clearBackpackCargoGlobal _unit;
  35.     };
  36.  
  37.     case "crate_med": {
  38.     clearWeaponCargoGlobal _unit;
  39.     clearMagazineCargoGlobal _unit;
  40.     clearItemCargoGlobal _unit;
  41.     clearBackpackCargoGlobal _unit;
  42.     };
  43.  
  44.     case "crate_large": {
  45.     clearWeaponCargoGlobal _unit;
  46.     clearMagazineCargoGlobal _unit;
  47.     clearItemCargoGlobal _unit;
  48.     clearBackpackCargoGlobal _unit;
  49.     };
  50.  
  51.     //Default class
  52.     default {
  53.         _unit addmagazines ["30Rnd_65x39_caseless_mag",7];
  54.         _unit addweapon "arifle_MX_pointer_F";
  55.         _unit selectweapon primaryweapon _unit;
  56.         if (true) exitwith {
  57.             player globalchat format ["DEBUG: Unit = %1. Gear template %2 does not exist, used Rifleman instead.", _unit, _typeofunit]
  58.         };
  59.     };
  60. };
  61.  
  62. //Now we deal with the units that want random clothes
  63. //i.e we store all of the items in the clothing in an array, replace the clothing and then re-add all the items
  64. if(_typeofUnit in _genericUnits) then {
  65.     _backpackItems = backpackItems _unit;
  66.     removeBackpack _unit;
  67.     _unit addBackpack selectrandom _backpacks;         
  68.     {
  69.         _unit addItemToBackpack _x;
  70.     } forEach _backpackItems;
  71.  
  72.     _vestitems = vestItems _unit;
  73.     removeVest _unit;
  74.     _unit addvest selectRandom _vests;
  75.  
  76.     { _unit addItemToVest _x; } forEach _vestitems;
  77.  
  78.     _uniformitems = uniformItems _unit;
  79.     removeUniform _unit;
  80.     _unit forceAddUniform selectRandom _uniforms;
  81.     {
  82.         _unit addItemToUniform _x;
  83.     } forEach _uniformitems;
  84.  
  85.     removeGoggles _unit;
  86.     _unit addGoggles selectRandom _goggles;
  87.  
  88.     removeHeadgear _unit;
  89.     _unit addHeadgear selectRandom _helmets;
  90.  
  91. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement