Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.78 KB | None | 0 0
  1. //By Eagledude4
  2.  
  3. _vehicle = _this select 0;
  4. _pos = _this select 1;
  5. _player = _this select 2;
  6.  
  7.  
  8. _moveDown = {
  9. player moveInCargo [_vehicle, _this select 0];
  10. ["Moving to next available cargo slot","hint",owner _player] call BIS_fnc_MP;
  11. [[player,"moving to next available cargo slot"],"globalChat",owner _player] call BIS_fnc_MP;
  12. };
  13.  
  14. _Kickout = {
  15. _player action ["Eject", _vehicle];
  16. waitUntil{vehicle _player == _player};
  17. _displayName = getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName");
  18. [format ["You must remove the %1's cargo before entering the cargo space.", _displayName],"hint",owner _player] call BIS_fnc_MP;
  19. [[player,format ["You must remove the %1's cargo before entering the cargo space.", _displayName]],"globalChat",owner _player] call BIS_fnc_MP;
  20. };
  21.  
  22. waitUntil {vehicle _player == _vehicle};
  23. if (_pos == "cargo") then {
  24. //Offroad
  25. if (typeOf _vehicle == "C_Offroad_01_F") then {
  26. if ((((_vehicle getCargoIndex _player) > 0)) && ((_vehicle getVariable "box_num") < 0)) then {
  27. if ((_vehicle getVariable "box_num") == -2) then {
  28. [] spawn _Kickout;
  29. };
  30.  
  31. if (((_vehicle getVariable "box_num") == -1) && (_vehicle getCargoIndex _player in [3,4])) then {
  32. _index = _vehicle getCargoIndex _player;
  33. _player action ["Eject", _vehicle];
  34. waitUntil{vehicle _player == _player};
  35. [_index - 2] spawn _moveDown;
  36. };
  37. } else {
  38. [getPlayerUID _player,side _player,getPosASL _player,6] call DB_fnc_updatePartial;
  39. };
  40. };
  41.  
  42.  
  43. //Zamak
  44. if (typeOf _vehicle in ["I_Truck_02_transport_F","I_Truck_02_covered_F"]) then {
  45. if ((!((_vehicle getCargoIndex _player) in [0,16])) && ((_vehicle getVariable "box_num") < 0)) then {
  46. if ((_vehicle getVariable "box_num") == -4) then {
  47. [] spawn _Kickout;
  48. };
  49.  
  50. if (((_vehicle getVariable "box_num") == -1) && (_vehicle getCargoIndex _player in [2,3,4,5])) then {
  51. _index = _vehicle getCargoIndex _player;
  52. _player action ["Eject", _vehicle];
  53. waitUntil{vehicle _player == _player};
  54.  
  55. switch (_index) do {
  56. case 2: {
  57. [_index + 4] spawn _moveDown;
  58. };
  59. case 3: {
  60. [_index + 3] spawn _moveDown;
  61. };
  62. case 4: {
  63. [_index + 2] spawn _moveDown;
  64. };
  65. case 5: {
  66. [_index + 1] spawn _moveDown;
  67. };
  68. };
  69. };
  70.  
  71. if (((_vehicle getVariable "box_num") == -2) && (_vehicle getCargoIndex _player in [2,3,4,5,6,7])) then {
  72. _index = _vehicle getCargoIndex _player;
  73. _player action ["Eject", _vehicle];
  74. waitUntil{vehicle _player == _player};
  75.  
  76. switch (_index) do {
  77. case 2: {
  78. [_index + 6] spawn _moveDown;
  79. };
  80. case 3: {
  81. [_index + 5] spawn _moveDown;
  82. };
  83. case 4: {
  84. [_index + 4] spawn _moveDown;
  85. };
  86. case 5: {
  87. [_index + 3] spawn _moveDown;
  88. };
  89. case 6: {
  90. [_index + 2] spawn _moveDown;
  91. };
  92. case 7: {
  93. [_index + 1] spawn _moveDown;
  94. };
  95. };
  96. };
  97.  
  98. if (((_vehicle getVariable "box_num") == -3) && (_vehicle getCargoIndex _player in [2,3,4,5,6,7,8,9,10,11])) then {
  99. _index = _vehicle getCargoIndex _player;
  100. _player action ["Eject", _vehicle];
  101. waitUntil{vehicle _player == _player};
  102.  
  103. switch (_index) do {
  104. case 2: {
  105. [_index + 10] spawn _moveDown;
  106. };
  107. case 3: {
  108. [_index + 9] spawn _moveDown;
  109. };
  110. case 4: {
  111. [_index + 8] spawn _moveDown;
  112. };
  113. case 5: {
  114. [_index + 7] spawn _moveDown;
  115. };
  116. case 6: {
  117. [_index + 6] spawn _moveDown;
  118. };
  119. case 7: {
  120. [_index + 5] spawn _moveDown;
  121. };
  122. case 8: {
  123. [_index + 4] spawn _moveDown;
  124. };
  125. case 9: {
  126. [_index + 3] spawn _moveDown;
  127. };
  128. case 10: {
  129. [_index + 2] spawn _moveDown;
  130. };
  131. case 11: {
  132. [_index + 1] spawn _moveDown;
  133. };
  134. };
  135. };
  136. } else {
  137. [getPlayerUID _player,side _player,getPosASL _player,6] call DB_fnc_updatePartial;
  138. };
  139. };
  140.  
  141.  
  142. //Tempest
  143. if (typeOf _vehicle in ["O_Truck_03_transport_F","O_Truck_03_covered_F"]) then {
  144. if ((!((_vehicle getCargoIndex _player) in [0,16])) && ((_vehicle getVariable "box_num") < 0)) then {
  145. if ((_vehicle getVariable "box_num") == -5) then {
  146. [] spawn _Kickout;
  147. };
  148.  
  149. if ((((_vehicle getVariable "box_num") == -1) or ((_vehicle getVariable "box_num") == -2)) && (_vehicle getCargoIndex _player in [1,6])) then {
  150. _index = _vehicle getCargoIndex _player;
  151. _player action ["Eject", _vehicle];
  152. waitUntil{vehicle _player == _player};
  153. [_index + 1] spawn _moveDown;
  154. };
  155.  
  156. if (((_vehicle getVariable "box_num") == -3) && (_vehicle getCargoIndex _player in [1,6,2,7,3,8])) then {
  157. _index = _vehicle getCargoIndex _player;
  158. _player action ["Eject", _vehicle];
  159. waitUntil{vehicle _player == _player};
  160.  
  161. switch (_index) do {
  162. case 1: {
  163. [_index + 3] spawn _moveDown;
  164. };
  165. case 6: {
  166. [_index + 3] spawn _moveDown;
  167. };
  168. case 2: {
  169. [_index + 2] spawn _moveDown;
  170. };
  171. case 7: {
  172. [_index + 2] spawn _moveDown;
  173. };
  174. case 3: {
  175. [_index + 1] spawn _moveDown;
  176. };
  177. case 8: {
  178. [_index + 1] spawn _moveDown;
  179. };
  180. };
  181. };
  182.  
  183. if (((_vehicle getVariable "box_num") == -4) && (_vehicle getCargoIndex _player in [1,6,2,7,3,8,4,9])) then {
  184. _index = _vehicle getCargoIndex _player;
  185. _player action ["Eject", _vehicle];
  186. waitUntil{vehicle _player == _player};
  187.  
  188. switch (_index) do {
  189. case 1: {
  190. [_index + 4] spawn _moveDown;
  191. };
  192. case 6: {
  193. [_index + 4] spawn _moveDown;
  194. };
  195. case 2: {
  196. [_index + 3] spawn _moveDown;
  197. };
  198. case 7: {
  199. [_index + 3] spawn _moveDown;
  200. };
  201. case 3: {
  202. [_index + 2] spawn _moveDown;
  203. };
  204. case 8: {
  205. [_index + 2] spawn _moveDown;
  206. };
  207. case 4: {
  208. [_index + 1] spawn _moveDown;
  209. };
  210. case 9: {
  211. [_index + 1] spawn _moveDown;
  212. };
  213. };
  214. };
  215. } else {
  216. [getPlayerUID _player,side _player,getPosASL _player,6] call DB_fnc_updatePartial;
  217. };
  218. };
  219.  
  220. //Hemitt
  221. if (typeOf _vehicle in ["B_Truck_01_covered_F","B_Truck_01_transport_F"]) then {
  222. if ((!((_vehicle getCargoIndex _player) in [0,17])) && ((_vehicle getVariable "box_num") < 0)) then {
  223. if ((_vehicle getVariable "box_num") == -5) then {
  224. [] spawn _Kickout;
  225. };
  226.  
  227. if (((_vehicle getVariable "box_num") == -1) && (_vehicle getCargoIndex _player in [1,8])) then {
  228. _index = _vehicle getCargoIndex _player;
  229. _player action ["Eject", _vehicle];
  230. waitUntil{vehicle _player == _player};
  231. [_index + 1] spawn _moveDown;
  232. };
  233.  
  234. if (((_vehicle getVariable "box_num") == -2) && (_vehicle getCargoIndex _player in [1,8,2,9])) then {
  235. _index = _vehicle getCargoIndex _player;
  236. _player action ["Eject", _vehicle];
  237. waitUntil{vehicle _player == _player};
  238.  
  239. switch (_index) do {
  240. case 1: {
  241. [_index + 2] spawn _moveDown;
  242. };
  243. case 8: {
  244. [_index + 2] spawn _moveDown;
  245. };
  246. case 2: {
  247. [_index + 1] spawn _moveDown;
  248. };
  249. case 9: {
  250. [_index + 1] spawn _moveDown;
  251. };
  252. };
  253. };
  254.  
  255. if (((_vehicle getVariable "box_num") == -3) && (_vehicle getCargoIndex _player in [1,8,2,9,3,10])) then {
  256. _index = _vehicle getCargoIndex _player;
  257. _player action ["Eject", _vehicle];
  258. waitUntil{vehicle _player == _player};
  259.  
  260. switch (_index) do {
  261. case 1: {
  262. [_index + 3] spawn _moveDown;
  263. };
  264. case 8: {
  265. [_index + 3] spawn _moveDown;
  266. };
  267. case 2: {
  268. [_index + 2] spawn _moveDown;
  269. };
  270. case 9: {
  271. [_index + 2] spawn _moveDown;
  272. };
  273. case 3: {
  274. [_index + 1] spawn _moveDown;
  275. };
  276. case 10: {
  277. [_index + 1] spawn _moveDown;
  278. };
  279. };
  280. };
  281.  
  282. if (((_vehicle getVariable "box_num") == -4) && (_vehicle getCargoIndex _player in [1,8,2,9,3,10,4,11,5,12])) then {
  283. _index = _vehicle getCargoIndex _player;
  284. _player action ["Eject", _vehicle];
  285. waitUntil{vehicle _player == _player};
  286.  
  287. switch (_index) do {
  288. case 1: {
  289. [_index + 5] spawn _moveDown;
  290. };
  291. case 8: {
  292. [_index + 5] spawn _moveDown;
  293. };
  294. case 2: {
  295. [_index + 4] spawn _moveDown;
  296. };
  297. case 9: {
  298. [_index + 4] spawn _moveDown;
  299. };
  300. case 3: {
  301. [_index + 3] spawn _moveDown;
  302. };
  303. case 10: {
  304. [_index + 3] spawn _moveDown;
  305. };
  306. case 4: {
  307. [_index + 2] spawn _moveDown;
  308. };
  309. case 11: {
  310. [_index + 2] spawn _moveDown;
  311. };
  312. case 5: {
  313. [_index + 1] spawn _moveDown;
  314. };
  315. case 12: {
  316. [_index + 1] spawn _moveDown;
  317. };
  318. };
  319. };
  320. } else {
  321. [getPlayerUID _player,side _player,getPosASL _player,6] call DB_fnc_updatePartial;
  322. };
  323. };
  324. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement