aeroson

Untitled

Jul 18th, 2016
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. params [
  2. "_box"
  3. ];
  4.  
  5.  
  6.  
  7. addLoadArsenalLoadoutMenu = {
  8.  
  9. params [
  10. "_unit"
  11. ];
  12.  
  13. private _virtualArsenalLoadouts = profilenamespace getvariable ["bis_fnc_saveInventory_data", nil];
  14.  
  15. if (!isNil {_virtualArsenalLoadouts}) then {
  16.  
  17. private _actionIds = [];
  18.  
  19. for "_i" from 0 to (count _virtualArsenalLoadouts) - 1 step 2 do {
  20.  
  21. private _loadoutName = _virtualArsenalLoadouts select _i;
  22.  
  23. private _actionId = _unit addAction [
  24. format["%1 - %2", _i/2+1, _loadoutName],
  25. {
  26. private _loadoutName = _this select 3;
  27. [player, [profilenamespace, _loadoutName]] call BIS_fnc_loadInventory;
  28. },
  29. _loadoutName
  30. ];
  31.  
  32. _actionIds pushBack _actionId;
  33. };
  34.  
  35. [_unit, _actionIds] spawn {
  36. params [
  37. "_unit",
  38. "_actionIds"
  39. ];
  40. sleep 30;
  41. {
  42. _unit removeAction _x;
  43. } forEach _actionIds;
  44. };
  45.  
  46. };
  47.  
  48. };
  49.  
  50. _box addAction [
  51. "Load Arsenal Loadout",
  52. {
  53. private _box = _this select 3;
  54. [_box] call addLoadArsenalLoadoutMenu;
  55. },
  56. _box
  57. ];
Advertisement
Add Comment
Please, Sign In to add comment