Advertisement
Guest User

randomEquipment.sqf

a guest
May 25th, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 5.79 KB | None | 0 0
  1. //Script made by ante185
  2.  
  3.  
  4. _akList = [
  5.     "rhs_weap_ak103",
  6.     "rhs_weap_ak104",
  7.     "rhs_weap_ak105",
  8.     "rhs_weap_ak74",
  9.     "rhs_weap_ak74_2",
  10.     "rhs_weap_aks74_2_folded",
  11.     "rhs_weap_ak74_3",
  12.     "rhs_weap_ak74n",
  13.     "rhs_weap_aks74n",
  14.     "rhs_weap_aks74n_folded",
  15.     "rhs_weap_aks74un",
  16.     "rhs_weap_aks74un_folded",
  17.     "rhs_weap_akm",
  18.     "rhs_weap_akms",
  19.     "rhs_weap_ak74m",
  20.     "rhs_weap_ak74m_2mag",
  21.     "rhs_weap_ak74m_2mag_camo",
  22.     "rhs_weap_ak74m_folded",
  23.     "rhs_weap_ak74m_camo",
  24.     "rhs_weap_ak74m_camo_folded",
  25.     "rhs_weap_ak74m_desert",
  26.     "rhs_weap_ak74m_desert_folded",
  27.     "rhs_weap_ak74m_fullplum",
  28.     "rhs_weap_ak74m_plummag_folded"
  29. ];
  30. _akList = _akList + _akList;
  31. _akList = _akList call BIS_fnc_arrayShuffle;
  32.  
  33. _akCount = count _akList;
  34.  
  35. _akgpList = [
  36.     "rhs_weap_ak103_gp25",
  37.     "rhs_weap_ak74_gp25",
  38.     "rhs_weap_akm_gp25",
  39.     "rhs_weap_akms_gp25",
  40.     "rhs_weap_ak74n_gp25",
  41.     "rhs_weap_aks74n_gp25",
  42.     "rhs_weap_ak74m_gp25",
  43.     "rhs_weap_ak74m_gp25_folded",
  44.     "rhs_weap_ak74m_fullplum_gp25",
  45.     "rhs_weap_ak74m_fullplum_gp25_folded"
  46. ];
  47. _akgpList = _akgpList + _akgpList;
  48. _akgpList = _akgpList call BIS_fnc_arrayShuffle;
  49.  
  50. _akgpCount = count _akgpList;
  51.  
  52. _arList = [
  53.     "rhs_weap_m16a4_carryhandle",
  54.     "rhs_weap_m4_carryhandle",
  55.     "rhs_weap_m4a1"
  56. ];
  57. _arList = _arList + _arList;
  58. _arList = _arList call BIS_fnc_arrayShuffle;
  59.  
  60. _arCount = count _arList;
  61.  
  62.  
  63.  
  64. _argpList = [
  65.     "rhs_weap_m16a4_carryhandle_M203",
  66.     "rhs_weap_m4_m203S",
  67.     "rhs_weap_m4a1_carryhandle_m203S"
  68. ];
  69. _argpList = _argpList + _argpList;
  70. _argpList = _argpList call BIS_fnc_arrayShuffle;
  71.  
  72. _argpCount = count _argpList;
  73.  
  74. //array of the AK and AR list, for randomization purposes
  75. _arakList = [_arList, _akList];
  76. _gpList = [_argpList, _akgpList];
  77.  
  78. _mgList = [
  79.     "rhs_weap_m249",
  80.     "rhs_weap_m249_pip",
  81.     "rhs_weap_pkm"
  82. ];
  83. _mgList = _mgList + _mgList;
  84. _mgList = _mgList call BIS_fnc_arrayShuffle;
  85.  
  86. _mgCount = count _mgList;
  87.    
  88. _rifleList = [
  89.     "rhs_weap_svd_pso1",
  90.     "rhs_weap_svds_pso1",
  91.     "rhs_weap_svdp_pso1",
  92.     "rhs_weap_m24sws_blk_leu",
  93.     "srifle_DMR_06_camo_F",
  94.     "srifle_DMR_06_camo_khs_F",
  95.     "srifle_DMR_06_olive_F"
  96. ];
  97. _rifleList = _rifleList + _rifleList;
  98. _rifleList = _rifleList call BIS_fnc_arrayShuffle;
  99.  
  100. _rifleCount = count _rifleList;
  101.  
  102. _rpgList = [
  103.     "rhs_weap_m72a7",
  104.     "rhs_weap_rpg7_pgo",
  105.     "rhs_weap_rpg7",
  106.     "rhs_weap_rpg26"
  107. ];
  108. _rpgList = _rpgList + _rpgList;
  109. _rpgList = _rpgList call BIS_fnc_arrayShuffle;
  110.  
  111. _rpgCount = count _rpgList;
  112.  
  113. if (isServer) then {
  114.     BIS_randomSeed1 = [];
  115.     BIS_randomSeed2 = [];
  116.     BIS_randomSeed3 = [];
  117.     BIS_randomSeed4 = [];
  118.     BIS_randomSeed5 = [];
  119.     BIS_randomSeed6 = [];
  120.     BIS_randomSeed7 = [];
  121.     _rnd1 = floor random _akCount;    
  122.     _this setVariable ["BIS_randomSeed1", _rnd1, TRUE];
  123.     _rnd2 = floor random _akgpCount;
  124.     _this setVariable ["BIS_randomSeed2", _rnd2, TRUE];
  125.     _rnd3 = floor random _arCount;    
  126.     _this setVariable ["BIS_randomSeed3", _rnd3, TRUE];
  127.     _rnd4 = floor random _argpCount;
  128.     _this setVariable ["BIS_randomSeed4", _rnd4, TRUE];
  129.     _rnd5 = floor random _mgCount;    
  130.     _this setVariable ["BIS_randomSeed5", _rnd5, TRUE];
  131.     _rnd6 = floor random _rifleCount;
  132.     _this setVariable ["BIS_randomSeed6", _rnd6, TRUE];
  133.     _rnd7 = floor random _rpgCount;
  134.     _this setVariable ["BIS_randomSeed7", _rnd7, TRUE];
  135.     _arorak = floor random 2;
  136.     _this setVariable ["BIS_randomSeed8", _arorak, TRUE];
  137. };
  138.  
  139. _oldWeapon = currentWeapon _this;
  140. _fiaAR = ["arifle_Mk20_F", "arifle_Mk20C_ACO_F","arifle_TRG20_ACO_F","arifle_TRG20_F","arifle_TRG21_F", "arifle_TRG21_MRCO_F"];
  141. _fiaGL = ["arifle_Mk20_GL_ACO_F", "arifle_TRG21_GL_F"];
  142. _fiaRIFLE = ["srifle_DMR_06_camo_khs_F", "arifle_Mk20_MRCO_F"];
  143. _fiaMG = ["LMG_Mk200_BI_F"];
  144. _fiaRPG = ["launch_RPG32_F"];
  145.  
  146. if (_oldWeapon in _fiaAR) then {
  147.  
  148.     waitUntil {!(isNil {_this getVariable "BIS_randomSeed1"})};
  149.     waitUntil {!(isNil {_this getVariable "BIS_randomSeed3"})};
  150.     waitUntil {!(isNil {_this getVariable "BIS_randomSeed8"})};
  151.    
  152.     _randomSeed1 = _this getVariable "BIS_randomSeed1";
  153.     _randomSeed3 = _this getVariable "BIS_randomSeed3";
  154.     _randomSeed8 = _this getVariable "BIS_randomSeed8";
  155.    
  156.     _getArray = (_arakList select _randomSeed8);
  157.     if (_getArray == _akList) then {
  158.         _getWeapon = (_akList select _randomSeed1);
  159.     };
  160.     else {
  161.         _getWeapon = (_arList select _randomSeed3);
  162.     };
  163.     _check = true;
  164. };
  165.  
  166. if (_oldWeapon in _fiaGL) then {
  167.  
  168.     waitUntil {!(isNil {_this getVariable "BIS_randomSeed1"})};
  169.     waitUntil {!(isNil {_this getVariable "BIS_randomSeed2"})};
  170.     waitUntil {!(isNil {_this getVariable "BIS_randomSeed8"})};
  171.    
  172.     _randomSeed2 = _this getVariable "BIS_randomSeed2";
  173.     _randomSeed4 = _this getVariable "BIS_randomSeed4";
  174.     _randomSeed8 = _this getVariable "BIS_randomSeed8";
  175.    
  176.     _getArray = (_gpList select _randomSeed8);
  177.     if (_getArray == _akgpList) then {
  178.         _getWeapon = (_akgpList select _randomSeed2);
  179.     };
  180.     else {
  181.         _getWeapon = (_argpList select _randomSeed4);
  182.     };
  183.     _check = true;
  184. };
  185.  
  186. if (_oldWeapon in _fiaRIFLE) then {
  187.  
  188.     waitUntil {!(isNil {_this getVariable "BIS_randomSeed6"})};
  189.    
  190.     _randomSeed6 = _this getVariable "BIS_randomSeed6";
  191.    
  192.     _getWeapon = (_rifleList select _randomSeed6);
  193.     _check = true;
  194. };
  195.  
  196. if (_oldWeapon in _fiaMG) then {
  197.  
  198.     waitUntil {!(isNil {_this getVariable "BIS_randomSeed5"})};
  199.    
  200.     _randomSeed5 = _this getVariable "BIS_randomSeed5";
  201.    
  202.     _getWeapon = (_mgList select _randomSeed5);
  203.     _check = true;
  204. };
  205.  
  206. if (_fiaRPG in(getUnitLoadout _this)) then {
  207.     waitUntil {!(isNil {_this getVariable "BIS_randomSeed7"})};
  208.    
  209.     _randomSeed7 = _this getVariable "BIS_randomSeed7";
  210.     _addRpg = true;
  211. };
  212.  
  213. if (_check) then {
  214.     removeAllWeapons _this;
  215.     [_this, _getWeapon, 6] call BIS_fnc_addWeapon;
  216.     if (_addRpg) then {
  217.         [_this, (_rpgList select _randomSeed7), 3] call BIS_fnc_addWeapon; 
  218.     };
  219. }
  220.  
  221. getUnitLoadout _this;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement