Advertisement
Guest User

Untitled

a guest
Dec 4th, 2013
139
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private ["_un","_bp","_Vest","_itS","_itP","_group","_da","_pP","_hat","_uni","_typeOf","_we","_ma","_uI","_vI"];
  2. _vI = vestItems _this;
  3. _uI = uniformItems _this;
  4. _bp = Backpack _this;
  5. _mag = primaryWeaponMagazine _this;
  6. _mag2 = secondaryWeaponMagazine _this;
  7. removeBackpack _this;
  8. //_ma = + (magazines _this);
  9. _we = + (weapons _this);
  10. //if (handgunWeapon _this != "") then {_we = _we - [handgunWeapon _this];};
  11. //_pM = handgunMagazine _this;
  12. //if (count _pM > 0) then {while {(_pM select 0) in _ma} do {_ma = _ma - _pM;};};
  13. _typeOf = typeOf _this;
  14. _uni = uniform _this;
  15. _hat = headgear _this;
  16. _pP = getposATL player;
  17. _da= damage _this;
  18. _Vest = Vest _this;
  19. //NEW UNIT
  20. _group = [[(_pP select 0)+10-(random 20),(_pP select 1)+10-(random 20),0], WEST, [_typeOf],[],[],[0.9,1.0]] call BIS_fnc_spawnGroup;
  21. _un = leader _group;
  22. removeallweapons _un;
  23. removeHeadgear _un;
  24. removeVest _un;
  25. //COPY SKILL
  26. {_un setSkill [_x,(_this skill _x)];} foreach ["general","commanding","reloadSpeed","courage","spotTime","spotDistance","endurance","aimingSpeed","aimingShake","aimingAccuracy"];
  27.  
  28. _itP = if (!isNil{primaryWeaponItems _this}) then {primaryWeaponItems _this} else {[]};
  29. _itS = if (!isNil{secondaryWeaponItems _this}) then {secondaryWeaponItems _this} else {[]};
  30.  
  31.  
  32. _un addUniform _uni;
  33.  
  34.  
  35. if (!isNil"_hat") then {
  36. _un addHeadgear _hat;
  37. };
  38. if (!isNil"_Vest") then {
  39. _un addVest _Vest;
  40. };
  41.  
  42.  
  43. removeallweapons _un;
  44. {if (_x != "" && {isClass(configFile >> "cfgWeapons" >> _x)}) then {_un addweapon _x;};} foreach _we;
  45.  
  46. if (!isNil"_bp") then {
  47. removeBackpack _un;
  48. _un addBackpack _bp;
  49. };
  50.  
  51.  
  52.  
  53. removeAllPrimaryWeaponItems _un;
  54. {
  55. if (_x != "") then {
  56. _un addPrimaryWeaponItem _x;
  57. };
  58. } foreach _itP;
  59. {
  60. if (_x != "") then {
  61. _un addSecondaryWeaponItem _x;
  62. };
  63. } foreach _itS;
  64.  
  65. {
  66. if (_x != "") then {
  67. if (isClass(configFile >> "cfgWeapons" >> _x)) then {
  68. _un addItem _x;
  69. } else {_un addmagazine _x;};
  70. };
  71. } foreach _vI + _uI;
  72.  
  73. _un setDamage _da;
  74.  
  75. _un setName (name _this);
  76. _un setFace (face _this);
  77. /*
  78. {
  79. if (_x != "" && {isClass(configFile >> "cfgMagazines" >> _x)}) then {
  80. _un addmagazine _x;
  81. };
  82. } foreach _ma;
  83. */
  84.  
  85.  
  86. if (count _mag > 0) then {
  87. _mag = _mag select 0;
  88. //_un addmagazine _mag;
  89. _un addmagazine _mag;
  90. //(_un) removeMagazines _mag;
  91. _t = 0;
  92. while {{_mag == _x} count (magazines (_un)) < 3 && {_t < 3}} do {
  93. _un addmagazine _mag;
  94. _t = _t + 1;
  95. };
  96. };
  97.  
  98.  
  99. if (count _mag2 > 0) then {
  100. _mag = _mag2 select 0;
  101. //_un addmagazine _mag;
  102. //(_un) removeMagazines _mag;
  103. _t = 0;
  104. while {{_mag == _x} count (magazines (_un)) < 1 && {_t < 1}} do {
  105. _un addmagazine _mag;
  106. _t = _t + 1;
  107. };
  108. };
  109.  
  110.  
  111.  
  112. {
  113. if !(isNil{_this getvariable _x}) then {_un setvariable [_x,(_this getvariable _x)];};
  114. } foreach ["Relationship","Tired","Sickness","Mental","CKills","Kills","FKills"];
  115.  
  116. deletevehicle _this;
  117. [_un] joinSilent player;
  118. /*
  119. sleep 3;
  120. hint format ["%1", magazines _un];
  121. */
Advertisement
RAW Paste Data Copied
Advertisement