Advertisement
Guest User

pack.sqf

a guest
Oct 22nd, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | None | 0 0
  1. private ["_player","_vehicle","_isveh","_finished","_finishedTime","_objectID","_objectUID"];
  2. _vehicle = cursorTarget;
  3. _player = player;
  4. _isveh = typeOf _vehicle in ["PBX","Old_bike_TK_CIV_EP1","MMT_Civ","M2StaticMG","DSHKM_Gue","AGS_TK_EP1","KORD_UN_EP1","SearchLight_Gue","TOW_TriPod_US_EP1","SPG9_TK_GUE_EP1","D30_TK_GUE_EP1","2b14_82mm_GUE","BAF_L2A1_Tripod_W"];
  5.  
  6. if !(_isveh && {player distance _vehicle <= 5}) exitWith {dayz_actionInProgress = false;};
  7.  
  8. dayz_actionInProgress = true;
  9.  
  10. _playerNear = {isPlayer _x} count (([_player] call FNC_GetPos) nearEntities ["CAManBase", 10]) > 1;
  11. if (_playerNear) exitWith {dayz_actionInProgress = false; localize "str_pickup_limit_5" call dayz_rollingMessages;};
  12.  
  13.  
  14. _player playActionNow "Medic";
  15. [_player,"repair",0,false,10] call dayz_zombieSpeak;
  16. [_player,10,true,(getPosATL _player)] spawn player_alertZombies;
  17.  
  18. r_interrupt = false;
  19. r_doLoop = true;
  20.  
  21. _finished = false;
  22. _finishedTime = diag_tickTime+8;
  23.  
  24. while {r_doLoop} do {
  25. if (diag_tickTime >= _finishedTime) then {
  26. r_doLoop = false;
  27. _finished = true;
  28. };
  29. if (r_interrupt) then {
  30. r_doLoop = false;
  31. };
  32. sleep 0.1;
  33. };
  34.  
  35. if (_finished) then {
  36. if !(player distance _vehicle <= 5) exitWith {dayz_actionInProgress = false;};
  37.  
  38.  
  39.  
  40.  
  41.  
  42. deleteVehicle _vehicle;
  43.  
  44. _objectID = _vehicle getVariable ["ObjectID", "0"];
  45. _objectUID = _vehicle getVariable ["ObjectUID", "0"];
  46.  
  47. [_objectID,_objectUID] call server_deleteObj;
  48. PVDZ_obj_Destroy = [_objectID,_objectUID,_vehicle];
  49. publicVariableServer "PVDZ_obj_Destroy";
  50.  
  51.  
  52.  
  53.  
  54. if (_vehicle isKindOf "TOW_TriPod_US_EP1") then {
  55. _player addMagazine ["ItemPole",2];
  56. _player addMagazine ["PartGeneric",2];
  57. _player addMagazine "ItemGoldBar";
  58.  
  59.  
  60. }else{
  61. if (_vehicle isKindOf "SPG9_TK_GUE_EP1") then {
  62.  
  63. _player addMagazine ["ItemPole",2];
  64. _player addMagazine ["PartGeneric",2];
  65. _player addMagazine "ItemGoldBar";
  66. }else{
  67. if (_vehicle isKindOf "D30_TK_GUE_EP1") then {
  68. _player addMagazine ["ItemPole",2];
  69. _player addMagazine ["PartGeneric",2];
  70. _player addMagazine ["ItemRuby",2];
  71. }else{
  72. if (_vehicle isKindOf "2b14_82mm_GUE") then {
  73.  
  74. _player addMagazine ["ItemPole",2];
  75. _player addMagazine ["PartGeneric",2];
  76. _player addMagazine ["ItemRuby",2];
  77.  
  78. }else{
  79. if (_vehicle isKindOf "BAF_L2A1_Tripod_W") then {
  80.  
  81.  
  82. _player addMagazine ["ItemPole",2];
  83. _player addMagazine ["PartGeneric",2];
  84. _player addMagazine "ItemRuby";
  85. }else{
  86.  
  87. if (_vehicle isKindOf "DSHKM_Gue") then {
  88. _player addMagazine ["ItemPole",2];
  89. _player addMagazine ["PartGeneric",2];
  90. _player addMagazine "ItemGoldBar";
  91. }else{
  92. if (_vehicle isKindOf "M2StaticMG") then {
  93.  
  94. _player addMagazine ["ItemPole",2];
  95. _player addMagazine ["PartGeneric",2];
  96. _player addMagazine "ItemGoldBar";
  97. }else{
  98. if (_vehicle isKindOf "AGS_TK_EP1") then {
  99.  
  100.  
  101. _player addMagazine ["ItemPole",2];
  102. _player addMagazine ["PartGeneric",2];
  103. _player addMagazine "ItemRuby";
  104. }else{
  105. if (_vehicle isKindOf "KORD_UN_EP1") then {
  106.  
  107. _player addMagazine ["ItemPole",2];
  108. _player addMagazine ["PartGeneric",2];
  109. _player addMagazine "ItemRuby";
  110.  
  111. }else{
  112. if (_vehicle isKindOf "SearchLight_Gue") then {
  113. _player addMagazine ["ItemPole",2];
  114. _player addMagazine ["PartGeneric",2];
  115. };
  116. };
  117. };
  118. };
  119. };
  120. };
  121. };
  122. };
  123. };
  124. };
  125.  
  126. _player addWeapon "ItemToolbox";
  127.  
  128.  
  129. cutText ["\nYou have packed a veh!", "PLAIN DOWN",2];
  130. dayz_actionInProgress = false;
  131. } else {
  132. r_interrupt = false;
  133. _player switchMove "";
  134. _player playActionNow "stop";
  135. dayz_actionInProgress = false;
  136. cutText ["\n\nCanceled pack veh!", "PLAIN DOWN",2];
  137. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement