Guest User

Untitled

a guest
Jul 12th, 2018
103
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * mf-tow/init.sqf
  3.  * The main script for initalising towing functionality.
  4.  *
  5.  * Created by Matt Fairbrass (matt_d_rat)
  6.  * Version: 1.1.2
  7.  * MIT Licence
  8.  **/
  9.  
  10.  
  11. private ["_cursorTarget", "_towableVehicles", "_towableVehiclesTotal"];
  12.  
  13. // Public variables
  14. MF_Tow_Base_Path        = "scripts\mf-tow";         // The base path to the MF-Tow Folder.
  15. MF_Tow_Distance         = 10;                   // Minimum distance (in meters) away from vehicle the tow truck must be to tow.
  16. MF_Tow_Multi_Towing     = false;                // Allow a vehicle which is towing another vehicle already to be towed by another tow. Disabled by default.
  17.  
  18. // Functions
  19.  
  20. /**
  21.  * Returns an array of towable objects which can be pulled by the tow truck.
  22.  * Configure this as required to set which vehicles can pull which types of other vehicles.
  23.  **/
  24. MF_Tow_Towable_Array =
  25. {
  26.     private ["_array","_towTruck","_spisok3","_spisok2","_spisok1"];
  27.     _towTruck = _this select 0;
  28.     _array = [];
  29.     _spisok1 = ["LandVehicle","Truck","Wheeled_APC","Tracked_APC","Air"];
  30.     _spisok2 = ["Car","Truck"];
  31.     _spisok3 = ["Car"];
  32.     switch (typeOf _towTruck) do
  33.     {
  34. case "Tractor":  {_array = spisok3;};
  35. case "car_sedan":  {_array = _spisok3;};
  36. case "policecar":  {_array = _spisok3;};
  37. case "HMMWV_M2":  {_array = _spisok3;};
  38. case "HMMWV_TOW":  {_array = _spisok3;};
  39. case "HMMWV_MK19":  {_array = _spisok3;};
  40. case "HMMWV":  {_array = _spisok3;};
  41. case "UAZ_MG_CDF":  {_array = _spisok3;};
  42. case "UAZ_AGS30_CDF":  {_array = _spisok3;};
  43. case "UAZ_CDF":  {_array = _spisok3;};
  44. case "Ural_CDF":  {_array = _spisok2;};
  45. case "UralOpen_CDF":  {_array = _spisok2;};
  46. case "UralRepair_CDF":  {_array = _spisok2;};
  47. case "UralReammo_CDF":  {_array = _spisok2;};
  48. case "UralRefuel_CDF":  {_array = _spisok2;};
  49. case "Ural_ZU23_CDF":  {_array = _spisok2;};
  50. case "UAZ_RU":  {_array = _spisok3;};
  51. case "UAZ_AGS30_RU":  {_array = _spisok3;};
  52. case "UAZ_MG_INS":  {_array = _spisok3;};
  53. case "UAZ_MG_INS":  {_array = _spisok3;};
  54. case "UAZ_AGS30_INS":  {_array = _spisok3;};
  55. case "UAZ_INS":  {_array = _spisok3;};
  56. case "UAZ_SPG9_INS":  {_array = _spisok3;};
  57. case "Ural_INS":  {_array = _spisok2;};
  58. case "UralOpen_INS":  {_array = _spisok2;};
  59. case "UralRepair_INS":  {_array = _spisok2;};
  60. case "UralReammo_INS":  {_array = _spisok2;};
  61. case "UralRefuel_INS":  {_array = _spisok2;};
  62. case "Ural_ZU23_INS":  {_array = _spisok2;};
  63. case "URAL_ZU23_Gue":  {_array = _spisok2;};
  64. case "UralCivil":  {_array = _spisok2;};
  65. case "UralCivil2":  {_array = _spisok2;};
  66. case "Skoda":  {_array = _spisok3;};
  67. case "SkodaBlue":  {_array = _spisok3;};
  68. case "SkodaRed":  {_array = _spisok3;};
  69. case "SkodaGreen":  {_array = _spisok3;};
  70. case "datsun1_civil_1_open":  {_array = _spisok3;};
  71. case "datsun1_civil_2_covered":  {_array = _spisok3;};
  72. case "datsun1_civil_3_open":  {_array = _spisok3;};
  73. case "tractorOld":  {_array = _spisok3;};
  74. case "car_hatchback":  {_array = _spisok3;};
  75. case "hilux1_civil_1_open":  {_array = _spisok3;};
  76. case "hilux1_civil_2_covered":  {_array = _spisok3;};
  77. case "hilux1_civil_3_open":  {_array = _spisok3;};
  78. case "Pickup_PK_GUE":  {_array = _spisok3;};
  79. case "Pickup_PK_INS":  {_array = _spisok3;};
  80. case "Offroad_DSHKM_Gue":  {_array = _spisok3;};
  81. case "Offroad_SPG9_Gue":  {_array = _spisok3;};
  82. case "Offroad_DSHKM_INS":  {_array = _spisok3;};
  83. case "GLT_M300_LT":  {_array = _spisok3;};
  84. case "GLT_M300_ST":  {_array = _spisok3;};
  85. case "GAZ_Vodnik_HMG":  {_array = _spisok3;};
  86. case "GAZ_Vodnik":  {_array = _spisok3;};
  87. case "GAZ_Vodnik_MedEvac":  {_array = _spisok3;};
  88. case "HMMWV_Armored":  {_array = _spisok3;};
  89. case "HMMWV_Ambulance":  {_array = _spisok3;};
  90. case "HMMWV_Avenger":  {_array = _spisok3;};
  91. case "Ikarus":  {_array = _spisok3;};
  92. case "Kamaz":  {_array = _spisok2;};
  93. case "KamazOpen":  {_array = _spisok2;};
  94. case "KamazRepair":  {_array = _spisok2;};
  95. case "KamazReammo":  {_array = _spisok2;};
  96. case "KamazRefuel":  {_array = _spisok2;};
  97. case "Lada1":  {_array = _spisok3;};
  98. case "Lada2":  {_array = _spisok3;};
  99. case "LadaLM":  {_array = _spisok3;};
  100. case "VWGolf":  {_array = _spisok3;};
  101. case "UAZ_MG_TK_EP1":  {_array = _spisok3;};
  102. case "UAZ_AGS30_TK_EP1":  {_array = _spisok3;};
  103. case "UAZ_Unarmed_TK_EP1":  {_array = _spisok3;};
  104. case "UAZ_Unarmed_UN_EP1":  {_array = _spisok3;};
  105. case "UAZ_Unarmed_TK_CIV_EP1":  {_array = _spisok3;};
  106. case "Ural_UN_EP1":  {_array = _spisok3;};
  107. case "Ural_TK_CIV_EP1":  {_array = _spisok3;};
  108. case "UralRepair_TK_EP1":  {_array = _spisok3;};
  109. case "UralReammo_TK_EP1":  {_array = _spisok3;};
  110. case "UralRefuel_TK_EP1":  {_array = _spisok3;};
  111. case "Ural_ZU23_TK_EP1":  {_array = _spisok3;};
  112. case "Ural_ZU23_TK_GUE_EP1":  {_array = _spisok3;};
  113. case "UralSupply_TK_EP1":  {_array = _spisok3;};
  114. case "UralSalvage_TK_EP1":  {_array = _spisok3;};
  115. case "Pickup_PK_TK_GUE_EP1":  {_array = _spisok3;};
  116. case "Offroad_DSHKM_TK_GUE_EP1":  {_array = _spisok3;};
  117. case "Offroad_SPG9_TK_GUE_EP1":  {_array = _spisok3;};
  118. case "HMMWV_DES_EP1":  {_array = _spisok3;};
  119. case "HMMWV_MK19_DES_EP1":  {_array = _spisok3;};
  120. case "HMMWV_Ambulance_DES_EP1":  {_array = _spisok3;};
  121. case "HMMWV_Ambulance_CZ_DES_EP1":  {_array = _spisok3;};
  122. case "MTVR_DES_EP1":  {_array = _spisok2;};
  123. case "MtvrReammo_DES_EP1":  {_array = _spisok2;};
  124. case "MtvrRefuel_DES_EP1":  {_array = _spisok2;};
  125. case "MtvrRepair_DES_EP1":  {_array = _spisok2;};
  126. case "MtvrSupply_DES_EP1":  {_array = _spisok2;};
  127. case "MtvrSalvage_DES_EP1":  {_array = _spisok2;};
  128. case "Lada1_TK_CIV_EP1":  {_array = _spisok3;};
  129. case "Lada2_TK_CIV_EP1":  {_array = _spisok3;};
  130. case "Ikarus_TK_CIV_EP1":  {_array = _spisok3;};
  131. case "hilux1_civil_3_open_EP1":  {_array = _spisok3;};
  132. case "ATV_US_EP1":  {_array = _spisok3;};
  133. case "ATV_CZ_EP1":  {_array = _spisok3;};
  134. case "BTR40_MG_TK_GUE_EP1":  {_array = _spisok3;};
  135. case "BTR40_TK_GUE_EP1":  {_array = _spisok3;};
  136. case "BTR40_MG_TK_INS_EP1":  {_array = _spisok3;};
  137. case "BTR40_TK_INS_EP1":  {_array = _spisok3;};
  138. case "BTR60_TK_EP1":  {_array = _spisok1;};
  139. case "HMMWV_M1035_DES_EP1":  {_array = _spisok3;};
  140. case "HMMWV_TOW_DES_EP1":  {_array = _spisok3;};
  141. case "HMMWV_TOW_DES_EP1":  {_array = _spisok3;};
  142. case "HMMWV_Terminal_EP1":  {_array = _spisok3;};
  143. case "LandRover_CZ_EP1":  {_array = _spisok3;};
  144. case "LandRover_TK_CIV_EP1":  {_array = _spisok3;};
  145. case "S1203_TK_CIV_EP1":  {_array = _spisok3;};
  146. case "S1203_ambulance_EP1":  {_array = _spisok3;};
  147. case "SUV_TK_CIV_EP1":  {_array = _spisok3;};
  148. case "SUV_TK_EP1":  {_array = _spisok3;};
  149. case "SUV_UN_EP1":  {_array = _spisok3;};
  150. case "Volha_1_TK_CIV_EP1":  {_array = _spisok3;};
  151. case "Volha_2_TK_CIV_EP1":  {_array = _spisok3;};
  152. case "VolhaLimo_TK_CIV_EP1":  {_array = _spisok3;};
  153. case "SUV_PMC":  {_array = _spisok3;};
  154. case "ArmoredSUV_PMC":  {_array = _spisok3;};
  155. case "HMMWV_DZ":  {_array = _spisok3;};
  156. case "UAZ_MG_TK_EP1_DZ":  {_array = _spisok3;};
  157. case "UAZ_MG_TK_EP1_DZE":  {_array = _spisok3;};
  158. case "GAZ_Vodnik_DZ":  {_array = _spisok3;};
  159. case "GAZ_Vodnik_DZE":  {_array = _spisok3;};
  160. case "ArmoredSUV_PMC_DZ":  {_array = _spisok3;};
  161. case "ArmoredSUV_PMC_DZE":  {_array = _spisok3;};
  162. case "Pickup_PK_TK_GUE_EP1_DZ":  {_array = _spisok3;};
  163. case "Pickup_PK_TK_GUE_EP1_DZE":  {_array = _spisok3;};
  164. case "Pickup_PK_GUE_DZ":  {_array = _spisok3;};
  165. case "Pickup_PK_GUE_DZE":  {_array = _spisok3;};
  166. case "Pickup_PK_INS_DZ":  {_array = _spisok3;};
  167. case "Pickup_PK_INS_DZE":  {_array = _spisok3;};
  168. case "Offroad_DSHKM_Gue_DZ":  {_array = _spisok3;};
  169. case "Offroad_DSHKM_Gue_DZE":  {_array = _spisok3;};
  170. case "Offroad_DSHKM_Gue_DZE1":  {_array = _spisok3;};
  171. case "Offroad_DSHKM_Gue_DZE2":  {_array = _spisok3;};
  172. case "Offroad_DSHKM_Gue_DZE3":  {_array = _spisok3;};
  173. case "Offroad_DSHKM_Gue_DZE4":  {_array = _spisok3;};
  174. case "V3S_TK_EP1_DZE":  {_array = _spisok3;};
  175. case "V3S_RA_TK_GUE_EP1":  {_array = _spisok3;};
  176. case "V3S_Refuel_TK_GUE_EP1":  {_array = _spisok3;};
  177. case "V3S_Refuel_TK_GUE_EP1_DZ":  {_array = _spisok3;};
  178. case "UralCivil_DZE":  {_array = _spisok3;};
  179. case "UralCivil2_DZE":  {_array = _spisok3;};
  180. case "UralRefuel_TK_EP1_DZ":  {_array = _spisok3;};
  181. case "KamazOpen_DZE":  {_array = _spisok3;};
  182. case "KamazRefuel_DZ":  {_array = _spisok3;};
  183. case "MtvrRefuel_DES_EP1_DZ":  {_array = _spisok3;};
  184. case "MtvrRefuel_DZ":  {_array = _spisok3;};
  185. case "VolhaLimo_TK_CIV_EP1_DZE1":  {_array = _spisok3;};
  186. case "Volha_1_TK_CIV_EP1_DZE1":  {_array = _spisok3;};
  187. case "Volha_2_TK_CIV_EP1_DZE1":  {_array = _spisok3;};
  188. case "VolhaLimo_TK_CIV_EP1_DZE2":  {_array = _spisok3;};
  189. case "Volha_1_TK_CIV_EP1_DZE2":  {_array = _spisok3;};
  190. case "Volha_2_TK_CIV_EP1_DZE2":  {_array = _spisok3;};
  191. case "VolhaLimo_TK_CIV_EP1_DZE3":  {_array = _spisok3;};
  192. case "Volha_1_TK_CIV_EP1_DZE3":  {_array = _spisok3;};
  193. case "Volha_2_TK_CIV_EP1_DZE3":  {_array = _spisok3;};
  194. case "VolhaLimo_TK_CIV_EP1_DZE4":  {_array = _spisok3;};
  195. case "Volha_1_TK_CIV_EP1_DZE4":  {_array = _spisok3;};
  196. case "Volha_2_TK_CIV_EP1_DZE4":  {_array = _spisok3;};
  197. case "VWGolf_DZE1":  {_array = _spisok3;};
  198. case "VWGolf_DZE2":  {_array = _spisok3;};
  199. case "VWGolf_DZE3":  {_array = _spisok3;};
  200. case "VWGolf_DZE4":  {_array = _spisok3;};
  201. case "Skoda_DZE1":  {_array = _spisok3;};
  202. case "SkodaBlue_DZE1":  {_array = _spisok3;};
  203. case "SkodaRed_DZE1":  {_array = _spisok3;};
  204. case "SkodaGreen_DZE1":  {_array = _spisok3;};
  205. case "Skoda_DZE2":  {_array = _spisok3;};
  206. case "SkodaBlue_DZE2":  {_array = _spisok3;};
  207. case "SkodaRed_DZE2":  {_array = _spisok3;};
  208. case "SkodaGreen_DZE2":  {_array = _spisok3;};
  209. case "Skoda_DZE3":  {_array = _spisok3;};
  210. case "SkodaBlue_DZE3":  {_array = _spisok3;};
  211. case "SkodaRed_DZE3":  {_array = _spisok3;};
  212. case "SkodaGreen_DZE3":  {_array = _spisok3;};
  213. case "Skoda_DZE4":  {_array = _spisok3;};
  214. case "SkodaBlue_DZE4":  {_array = _spisok3;};
  215. case "SkodaRed_DZE4":  {_array = _spisok3;};
  216. case "SkodaGreen_DZE4":  {_array = _spisok3;};
  217. case "car_hatchback_DZE1":  {_array = _spisok3;};
  218. case "car_hatchback_DZE2":  {_array = _spisok3;};
  219. case "car_hatchback_DZE3":  {_array = _spisok3;};
  220. case "car_hatchback_DZE4":  {_array = _spisok3;};
  221. case "car_sedan_DZE1":  {_array = _spisok3;};
  222. case "car_sedan_DZE2":  {_array = _spisok3;};
  223. case "car_sedan_DZE3":  {_array = _spisok3;};
  224. case "car_sedan_DZE4":  {_array = _spisok3;};
  225. case "datsun1_civil_1_open_DZE1":  {_array = _spisok3;};
  226. case "datsun1_civil_2_covered_DZE1":  {_array = _spisok3;};
  227. case "datsun1_civil_3_open_DZE1":  {_array = _spisok3;};
  228. case "datsun1_civil_1_open_DZE2":  {_array = _spisok3;};
  229. case "datsun1_civil_2_covered_DZE2":  {_array = _spisok3;};
  230. case "datsun1_civil_3_open_DZE2":  {_array = _spisok3;};
  231. case "datsun1_civil_1_open_DZE3":  {_array = _spisok3;};
  232. case "datsun1_civil_2_covered_DZE3":  {_array = _spisok3;};
  233. case "datsun1_civil_3_open_DZE3":  {_array = _spisok3;};
  234. case "datsun1_civil_1_open_DZE4":  {_array = _spisok3;};
  235. case "datsun1_civil_2_covered_DZE4":  {_array = _spisok3;};
  236. case "datsun1_civil_3_open_DZE4":  {_array = _spisok3;};
  237. case "Lada1_DZE1":  {_array = _spisok3;};
  238. case "Lada2_DZE1":  {_array = _spisok3;};
  239. case "LadaLM_DZE1":  {_array = _spisok3;};
  240. case "Lada1_TK_CIV_EP1_DZE1":  {_array = _spisok3;};
  241. case "Lada2_TK_CIV_EP1_DZE1":  {_array = _spisok3;};
  242. case "Lada1_DZE2":  {_array = _spisok3;};
  243. case "Lada2_DZE2":  {_array = _spisok3;};
  244. case "LadaLM_DZE2":  {_array = _spisok3;};
  245. case "Lada1_TK_CIV_EP1_DZE2":  {_array = _spisok3;};
  246. case "Lada2_TK_CIV_EP1_DZE2":  {_array = _spisok3;};
  247. case "Lada1_DZE3":  {_array = _spisok3;};
  248. case "Lada2_DZE3":  {_array = _spisok3;};
  249. case "LadaLM_DZE3":  {_array = _spisok3;};
  250. case "Lada1_TK_CIV_EP1_DZE3":  {_array = _spisok3;};
  251. case "Lada2_TK_CIV_EP1_DZE3":  {_array = _spisok3;};
  252. case "Lada1_DZE4":  {_array = _spisok3;};
  253. case "Lada2_DZE4":  {_array = _spisok3;};
  254. case "LadaLM_DZE4":  {_array = _spisok3;};
  255. case "Lada1_TK_CIV_EP1_DZE4":  {_array = _spisok3;};
  256. case "Lada2_TK_CIV_EP1_DZE4":  {_array = _spisok3;};
  257. case "hilux1_civil_1_open_DZE1":  {_array = _spisok3;};
  258. case "hilux1_civil_2_covered_DZE1":  {_array = _spisok3;};
  259. case "hilux1_civil_3_open_DZE1":  {_array = _spisok3;};
  260. case "hilux1_civil_1_open_DZE2":  {_array = _spisok3;};
  261. case "hilux1_civil_2_covered_DZE2":  {_array = _spisok3;};
  262. case "hilux1_civil_3_open_DZE2":  {_array = _spisok3;};
  263. case "hilux1_civil_1_open_DZE3":  {_array = _spisok3;};
  264. case "hilux1_civil_2_covered_DZE3":  {_array = _spisok3;};
  265. case "hilux1_civil_3_open_DZE3":  {_array = _spisok3;};
  266. case "hilux1_civil_1_open_DZE4":  {_array = _spisok3;};
  267. case "hilux1_civil_2_covered_DZE4":  {_array = _spisok3;};
  268. case "hilux1_civil_3_open_DZE4":  {_array = _spisok3;};
  269. case "UAZ_CDF_DZE1":  {_array = _spisok3;};
  270. case "UAZ_INS_DZE1":  {_array = _spisok3;};
  271. case "UAZ_RU_DZE1":  {_array = _spisok3;};
  272. case "UAZ_Unarmed_TK_EP1_DZE1":  {_array = _spisok3;};
  273. case "UAZ_Unarmed_UN_EP1_DZE1":  {_array = _spisok3;};
  274. case "UAZ_Unarmed_TK_CIV_EP1_DZE1":  {_array = _spisok3;};
  275. case "UAZ_CDF_DZE2":  {_array = _spisok3;};
  276. case "UAZ_INS_DZE2":  {_array = _spisok3;};
  277. case "UAZ_RU_DZE2":  {_array = _spisok3;};
  278. case "UAZ_Unarmed_TK_EP1_DZE2":  {_array = _spisok3;};
  279. case "UAZ_Unarmed_UN_EP1_DZE2":  {_array = _spisok3;};
  280. case "UAZ_Unarmed_TK_CIV_EP1_DZE2":  {_array = _spisok3;};
  281. case "UAZ_CDF_DZE3":  {_array = _spisok3;};
  282. case "UAZ_INS_DZE3":  {_array = _spisok3;};
  283. case "UAZ_RU_DZE3":  {_array = _spisok3;};
  284. case "UAZ_Unarmed_TK_EP1_DZE3":  {_array = _spisok3;};
  285. case "UAZ_Unarmed_UN_EP1_DZE3":  {_array = _spisok3;};
  286. case "UAZ_Unarmed_TK_CIV_EP1_DZE3":  {_array = _spisok3;};
  287. case "UAZ_CDF_DZE4":  {_array = _spisok3;};
  288. case "UAZ_INS_DZE4":  {_array = _spisok3;};
  289. case "UAZ_RU_DZE4":  {_array = _spisok3;};
  290. case "UAZ_Unarmed_TK_EP1_DZE4":  {_array = _spisok3;};
  291. case "UAZ_Unarmed_UN_EP1_DZE4":  {_array = _spisok3;};
  292. case "UAZ_Unarmed_TK_CIV_EP1_DZE4":  {_array = _spisok3;};
  293. case "SUV_Camo":  {_array = _spisok3;};
  294. case "SUV_Blue":  {_array = _spisok3;};
  295. case "SUV_Green":  {_array = _spisok3;};
  296. case "SUV_Yellow":  {_array = _spisok3;};
  297. case "SUV_Red":  {_array = _spisok3;};
  298. case "SUV_White":  {_array = _spisok3;};
  299. case "SUV_Pink":  {_array = _spisok3;};
  300. case "SUV_Charcoal":  {_array = _spisok3;};
  301. case "SUV_Orange":  {_array = _spisok3;};
  302. case "SUV_Silver":  {_array = _spisok3;};
  303. case "SUV_TK_CIV_EP1_DZE1":  {_array = _spisok3;};
  304. case "SUV_Camo_DZE1":  {_array = _spisok3;};
  305. case "SUV_Blue_DZE1":  {_array = _spisok3;};
  306. case "SUV_Green_DZE1":  {_array = _spisok3;};
  307. case "SUV_Yellow_DZE1":  {_array = _spisok3;};
  308. case "SUV_Red_DZE1":  {_array = _spisok3;};
  309. case "SUV_White_DZE1":  {_array = _spisok3;};
  310. case "SUV_Pink_DZE1":  {_array = _spisok3;};
  311. case "SUV_Charcoal_DZE1":  {_array = _spisok3;};
  312. case "SUV_Orange_DZE1":  {_array = _spisok3;};
  313. case "SUV_Silver_DZE1":  {_array = _spisok3;};
  314. case "SUV_TK_CIV_EP1_DZE2":  {_array = _spisok3;};
  315. case "SUV_Camo_DZE2":  {_array = _spisok3;};
  316. case "SUV_Blue_DZE2":  {_array = _spisok3;};
  317. case "SUV_Green_DZE2":  {_array = _spisok3;};
  318. case "SUV_Yellow_DZE2":  {_array = _spisok3;};
  319. case "SUV_Red_DZE2":  {_array = _spisok3;};
  320. case "SUV_White_DZE2":  {_array = _spisok3;};
  321. case "SUV_Pink_DZE2":  {_array = _spisok3;};
  322. case "SUV_Charcoal_DZE2":  {_array = _spisok3;};
  323. case "SUV_Orange_DZE2":  {_array = _spisok3;};
  324. case "SUV_Silver_DZE2":  {_array = _spisok3;};
  325. case "SUV_TK_CIV_EP1_DZE3":  {_array = _spisok3;};
  326. case "SUV_Camo_DZE3":  {_array = _spisok3;};
  327. case "SUV_Blue_DZE3":  {_array = _spisok3;};
  328. case "SUV_Green_DZE3":  {_array = _spisok3;};
  329. case "SUV_Yellow_DZE3":  {_array = _spisok3;};
  330. case "SUV_Red_DZE3":  {_array = _spisok3;};
  331. case "SUV_White_DZE3":  {_array = _spisok3;};
  332. case "SUV_Pink_DZE3":  {_array = _spisok3;};
  333. case "SUV_Charcoal_DZE3":  {_array = _spisok3;};
  334. case "SUV_Orange_DZE3":  {_array = _spisok3;};
  335. case "SUV_Silver_DZE3":  {_array = _spisok3;};
  336. case "SUV_TK_CIV_EP1_DZE4":  {_array = _spisok3;};
  337. case "SUV_Camo_DZE4":  {_array = _spisok3;};
  338. case "SUV_Blue_DZE4":  {_array = _spisok3;};
  339. case "SUV_Green_DZE4":  {_array = _spisok3;};
  340. case "SUV_Yellow_DZE4":  {_array = _spisok3;};
  341. case "SUV_Red_DZE4":  {_array = _spisok3;};
  342. case "SUV_White_DZE4":  {_array = _spisok3;};
  343. case "SUV_Pink_DZE4":  {_array = _spisok3;};
  344. case "SUV_Charcoal_DZE4":  {_array = _spisok3;};
  345. case "SUV_Orange_DZE4":  {_array = _spisok3;};
  346. case "SUV_Silver_DZE4":  {_array = _spisok3;};
  347. case "WarfareSalvageTruck_USMC":  {_array = _spisok3;};
  348. case "WarfareSupplyTruck_USMC":  {_array = _spisok3;};
  349. case "WarfareReammoTruck_USMC":  {_array = _spisok3;};
  350. case "WarfareSalvageTruck_RU":  {_array = _spisok3;};
  351. case "WarfareSupplyTruck_RU":  {_array = _spisok3;};
  352. case "WarfareReammoTruck_RU":  {_array = _spisok3;};
  353. case "WarfareSalvageTruck_CDF":  {_array = _spisok3;};
  354. case "WarfareSupplyTruck_CDF":  {_array = _spisok3;};
  355. case "WarfareReammoTruck_CDF":  {_array = _spisok3;};
  356. case "WarfareSalvageTruck_INS":  {_array = _spisok3;};
  357. case "WarfareSupplyTruck_INS":  {_array = _spisok3;};
  358. case "WarfareReammoTruck_INS":  {_array = _spisok3;};
  359. case "WarfareSalvageTruck_Gue":  {_array = _spisok3;};
  360. case "WarfareSupplyTruck_Gue":  {_array = _spisok3;};
  361. case "WarfareReammoTruck_Gue":  {_array = _spisok3;};
  362. case "WarfareRepairTruck_Gue":  {_array = _spisok3;};
  363. case "V3S_TK_EP1":  {_array = _spisok2;};
  364. case "V3S_Open_TK_EP1":  {_array = _spisok2;};
  365. case "V3S_Open_TK_CIV_EP1":  {_array = _spisok2;};
  366. case "V3S_TK_GUE_EP1":  {_array = _spisok2;};
  367. case "V3S_Repair_TK_GUE_EP1":  {_array = _spisok2;};
  368. case "V3S_Reammo_TK_GUE_EP1":  {_array = _spisok2;};
  369. case "V3S_Supply_TK_GUE_EP1":  {_array = _spisok2;};
  370. case "V3S_Salvage_TK_GUE_EP1":  {_array = _spisok2;};
  371. case "SUV_PMC_BAF":  {_array = _spisok3;};
  372. case "BAF_Offroad_D":  {_array = _spisok3;};
  373. case "BAF_ATV_W":  {_array = _spisok3;};
  374. case "BAF_Offroad_W":  {_array = _spisok3;};
  375.     };
  376.    
  377.     _array
  378. };
  379.  
  380. /**
  381.  * Animate the player in a towing action, whilst attaching them to the tow vehicle to ensure safety.
  382.  **/
  383. MF_Tow_Animate_Player_Tow_Action =
  384. {
  385.     private ["_towTruck","_offsetZ"];
  386.     _towTruck = _this select 0;
  387.     _offsetZ = 0.1;
  388.    
  389.     // Bounding box on UAZ is screwed, offset z-axis correctly
  390.     if(_towTruck isKindOf "UAZ_Base") then {
  391.         _offsetZ = 1.8;
  392.     };
  393.    
  394.     [player,20,true,(getPosATL player)] spawn player_alertZombies; // Alert nearby zombies
  395.     ["Working",0,[3,2,8,0]] call dayz_NutritionSystem; // Use some hunger and thirst to perform the action
  396.    
  397.     // Attach the player to the tow truck temporarily for safety so that they aren't accidentally hit by the vehicle when it gets attached
  398.     player attachTo [_towTruck,
  399.         [
  400.             (boundingBox _towTruck select 1 select 0),
  401.             (boundingBox _towTruck select 0 select 1) + 1,
  402.             (boundingBox _towTruck select 0 select 2) - (boundingBox player select 0 select 2) + _offsetZ
  403.         ]
  404.     ];
  405.  
  406.     player setDir 270;
  407.     player setPos (getPos player);
  408.     player playActionNow "Medic"; // Force the animation
  409. };
  410.  
  411. MF_Tow_Get_Vehicle_Name =
  412. {
  413.     private ["_vehicle", "_configVeh", "_vehicleName"];
  414.     _vehicle = _this select 0;
  415.    
  416.     _configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
  417.     _vehicleName = getText(_configVeh >> "displayName");
  418.    
  419.     _vehicleName
  420. };
  421.  
  422. // Initialise script
  423. _cursorTarget = cursorTarget;
  424. _towableVehicles = [_cursorTarget] call MF_Tow_Towable_Array;
  425. _towableVehiclesTotal = count (_towableVehicles);
  426.  
  427. _findNearestVehicle = [];
  428. if(_towableVehiclesTotal > 0) then {
  429. // Get all nearby vehicles that can be towed by the towTruck within the minimum tow distance
  430. _findNearestVehicles = nearestObjects [_cursorTarget, _towableVehicles, MF_Tow_Distance];
  431.  
  432. {
  433.     if (alive _x && _cursorTarget != _x) then {
  434.         _findNearestVehicle set [(count _findNearestVehicle),_x];
  435.     };
  436. } foreach _findNearestVehicles;
  437. };     
  438. _IsNearVehicle = count (_findNearestVehicle);
  439.  
  440. if(_IsNearVehicle > 0) then {
  441.  
  442.  
  443. // Add the action to the players scroll wheel menu if the cursor target is a vehicle which can tow.
  444. if(_towableVehiclesTotal > 0) then {
  445.     if (s_player_towing < 0) then {
  446.         if(!(_cursorTarget getVariable ["MFTowIsTowing", false])) then {
  447.             s_player_towing = player addAction ["<t color=""#dddd00"">Прицепить</t>", format["%1\tow_AttachTow.sqf", MF_Tow_Base_Path], _cursorTarget, 0, false, true, "",""];            
  448.         } else {
  449.        
  450.           s_player_towing = player addAction ["<t color=""#dddd00"">Отцепить</t>", format["%1\tow_DetachTow.sqf", MF_Tow_Base_Path], _cursorTarget, 0, false, true, "",""];   
  451.                    
  452.         };
  453.     };
  454.     }
  455.     else {
  456.         player removeAction s_player_towing;
  457.         s_player_towing = -1;
  458.     };
  459. };
RAW Paste Data