Guest User

Untitled

a guest
May 19th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. #include "..\..\script_macros.hpp"
  2. /*
  3. File: fn_weaponShopAccs.sqf
  4. Author: Daniel Stuart
  5. Description:
  6. Set Weapon Shop in accessories mode
  7. */
  8. disableSerialization;
  9.  
  10. if ((uiNamespace getVariable ["Weapon_Accessories",0]) isEqualTo 0) then {
  11. private["_weapon","_slotArray","_weaponArray"];
  12. _weapon = lbData[38403,lbCurSel (38403)];
  13. _slotArray = [];
  14. _weaponArray = [];
  15.  
  16. if (isArray (configFile >> "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> "CowsSlot" >> "compatibleItems")) then {
  17. _slotArray = FETCH_CONFIG3(getArray,"CfgWeapons",_weapon,"WeaponSlotsInfo","CowsSlot","compatibleItems");
  18. {
  19. _weaponArray pushBack _x;
  20. } forEach _slotArray;
  21. };
  22. if (isArray (configFile >> "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> "MuzzleSlot" >> "compatibleItems")) then {
  23. _slotArray = FETCH_CONFIG3(getArray,"CfgWeapons",_weapon,"WeaponSlotsInfo","MuzzleSlot","compatibleItems");
  24. {
  25. _weaponArray pushBack _x;
  26. } forEach _slotArray;
  27. };
  28. if (isArray (configFile >> "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> "PointerSlot" >> "compatibleItems")) then {
  29. _slotArray = FETCH_CONFIG3(getArray,"CfgWeapons",_weapon,"WeaponSlotsInfo","PointerSlot","compatibleItems");
  30. {
  31. _weaponArray pushBack _x;
  32. } forEach _slotArray;
  33. };
  34. if (isArray (configFile >> "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> "UnderBarrelSlot" >> "compatibleItems")) then {
  35. _slotArray = FETCH_CONFIG3(getArray,"CfgWeapons",_weapon,"WeaponSlotsInfo","UnderBarrelSlot","compatibleItems");
  36. {
  37. _weaponArray pushBack _x;
  38. } forEach _slotArray;
  39. };
  40. uiNamespace setVariable["Accessories_Array",_weaponArray];
  41. uiNamespace setVariable["Weapon_Accessories",1];
  42. } else {
  43. uiNamespace setVariable["Weapon_Accessories",0];
  44. };
Add Comment
Please, Sign In to add comment