Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
1,775
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.82 KB | None | 0 0
  1. /*___|Author: Hanuman|____
  2. [DO NOT REMOVE THIS CREDIT]
  3. */
  4.  
  5. #include <a_samp>
  6. new Text:speedo1;
  7. new PlayerText:speedo2[MAX_PLAYERS];
  8. new Text:Circles[4];
  9. new Text:BigLines[14];
  10. new Text:MPH[14];
  11. new Text:MPHT;
  12. new Text:SmallLines[13];
  13. new Text:GearBox0;
  14. new Text:GearBox1;
  15. new Text:SpeedBox0;
  16. new Text:SpeedBox1;
  17. new PlayerText:Speed[MAX_PLAYERS];
  18. new PlayerText:Gear[MAX_PLAYERS];
  19. new PlayerText:needle[MAX_PLAYERS][9];
  20. new PlayerText:Backneedle[MAX_PLAYERS][4];
  21. new Text:Shade0;
  22. new Text:Shade1;
  23.  
  24. stock RotationXY(Float:StartPosX, Float:StartPosY, &Float:NewX, &Float:NewY, Float:rotation, Float:dist)
  25. {
  26. NewX = StartPosX + (dist * floatsin(rotation, degrees));
  27. NewY = StartPosY + (dist * floatcos(rotation, degrees));
  28. }
  29.  
  30. public OnFilterScriptInit()
  31. {
  32. print("\n----------------------------------------------");
  33. print(" Hanu Speedometer v2.0 Loaded. [Author: Hanuman]");
  34. print("----------------------------------------------\n");
  35.  
  36. speedo1 = TextDrawCreate(430.000000, 220.000000+35.0, "_");
  37. TextDrawFont(speedo1, TEXT_DRAW_FONT_MODEL_PREVIEW);
  38. TextDrawBackgroundColor(speedo1, 0x00000000);
  39. TextDrawSetPreviewModel(speedo1, 19159);
  40. TextDrawTextSize(speedo1, 165.0, 175.0);
  41. TextDrawSetPreviewRot(speedo1, 90.0, 0.0, 0.0, 0.505);
  42. TextDrawColor(speedo1, 0x00000055);
  43.  
  44. Circles[0] = TextDrawCreate(420.000000, 247.000000, "hud:radardisc");
  45. TextDrawFont(Circles[0], 4);
  46. TextDrawLetterSize(Circles[0], 0.500000, 1.000000);
  47. TextDrawBackgroundColor(Circles[0], 0x00000000);
  48. TextDrawTextSize(Circles[0], 94.0, 94.0);
  49. TextDrawColor(Circles[0], 0x000000FF);
  50.  
  51.  
  52. Circles[1] = TextDrawCreate(605.000000, 247.000000, "hud:radardisc");
  53. TextDrawFont(Circles[1], 4);
  54. TextDrawLetterSize(Circles[1], 0.500000, 1.000000);
  55. TextDrawBackgroundColor(Circles[1], 0x00000000);
  56. TextDrawTextSize(Circles[1], -94.0, 94.0);
  57. TextDrawColor(Circles[1], 0x000000FF);
  58.  
  59.  
  60. Circles[2] = TextDrawCreate(605.000000, 435.000000, "hud:radardisc");
  61. TextDrawFont(Circles[2], 4);
  62. TextDrawLetterSize(Circles[2], 0.500000, 1.000000);
  63. TextDrawBackgroundColor(Circles[2], 0x00000000);
  64. TextDrawTextSize(Circles[2], -94.0, -94.0);
  65. TextDrawColor(Circles[2], 0x000000ff);
  66.  
  67.  
  68. Circles[3] = TextDrawCreate(420.000000, 435.000000, "hud:radardisc");
  69. TextDrawFont(Circles[3], 4);
  70. TextDrawLetterSize(Circles[3], 0.500000, 1.000000);
  71. TextDrawBackgroundColor(Circles[3], 0x00000000);
  72. TextDrawTextSize(Circles[3], 94.0, -94.0);
  73. TextDrawColor(Circles[3], 0x000000ff);
  74.  
  75. BigLines[0] = TextDrawCreate(448.700000, 349.200000+35.0, "_");
  76. TextDrawFont(BigLines[0], TEXT_DRAW_FONT_MODEL_PREVIEW);
  77. TextDrawBackgroundColor(BigLines[0], 0x00000000);
  78. TextDrawSetPreviewModel(BigLines[0], 19449);
  79. TextDrawTextSize(BigLines[0], 14.0, 14.0);
  80. TextDrawSetPreviewRot(BigLines[0], 0.0, 41.0, 90.0, 1);
  81. TextDrawColor(BigLines[0], 0x0C860CFF);
  82. TextDrawAlignment(BigLines[0], 1);
  83.  
  84.  
  85. BigLines[1] = TextDrawCreate(436.400000, 325.800000+35.0, "_");
  86. TextDrawFont(BigLines[1], TEXT_DRAW_FONT_MODEL_PREVIEW);
  87. TextDrawBackgroundColor(BigLines[1], 0x00000000);
  88. TextDrawSetPreviewModel(BigLines[1], 19449);
  89. TextDrawTextSize(BigLines[1], 14.0, 14.0);
  90. TextDrawSetPreviewRot(BigLines[1], 0.0, 20.0, 90.0, 1);
  91. TextDrawColor(BigLines[1], 0x0C860CFF);
  92. TextDrawAlignment(BigLines[1], 1);
  93.  
  94.  
  95. BigLines[2] = TextDrawCreate(432.500000, 299.750000+35.0, "_");
  96. TextDrawFont(BigLines[2], TEXT_DRAW_FONT_MODEL_PREVIEW);
  97. TextDrawBackgroundColor(BigLines[2], 0x00000000);
  98. TextDrawSetPreviewModel(BigLines[2], 19449);
  99. TextDrawTextSize(BigLines[2], 14.0, 14.0);
  100. TextDrawSetPreviewRot(BigLines[2], 0.0, 0.0, 90.0, 1);
  101. TextDrawColor(BigLines[2], 0x0C860CFF);
  102. TextDrawAlignment(BigLines[2], 1);
  103.  
  104.  
  105. BigLines[3] = TextDrawCreate(437.000000, 273.800000+35.0, "_");
  106. TextDrawFont(BigLines[3], TEXT_DRAW_FONT_MODEL_PREVIEW);
  107. TextDrawBackgroundColor(BigLines[3], 0x00000000);
  108. TextDrawSetPreviewModel(BigLines[3], 19449);
  109. TextDrawTextSize(BigLines[3], 14.0, 14.0);
  110. TextDrawSetPreviewRot(BigLines[3], 0.0, -21.0, 90.0, 1);
  111. TextDrawColor(BigLines[3], 0x0C860CFF);
  112. TextDrawAlignment(BigLines[3], 1);
  113.  
  114.  
  115. BigLines[4] = TextDrawCreate(450.200000, 250.200000+35.0, "_");
  116. TextDrawFont(BigLines[4], TEXT_DRAW_FONT_MODEL_PREVIEW);
  117. TextDrawBackgroundColor(BigLines[4], 0x00000000);
  118. TextDrawSetPreviewModel(BigLines[4], 19449);
  119. TextDrawTextSize(BigLines[4], 14.0, 14.0);
  120. TextDrawSetPreviewRot(BigLines[4], 0.0, -42.0, 90.0, 1);
  121. TextDrawColor(BigLines[4], 0x0C860CFF);
  122. TextDrawAlignment(BigLines[4], 1);
  123.  
  124.  
  125. BigLines[5] = TextDrawCreate(470.900000, 232.400000+35.0, "_");
  126. TextDrawFont(BigLines[5], TEXT_DRAW_FONT_MODEL_PREVIEW);
  127. TextDrawBackgroundColor(BigLines[5], 0x00000000);
  128. TextDrawSetPreviewModel(BigLines[5], 19449);
  129. TextDrawTextSize(BigLines[5], 14.0, 14.0);
  130. TextDrawSetPreviewRot(BigLines[5], 0.0, -63.0, 90.0, 1);
  131. TextDrawColor(BigLines[5], 0xBDBD00FF);
  132. TextDrawAlignment(BigLines[5], 1);
  133.  
  134.  
  135. BigLines[6] = TextDrawCreate(496.900000, 223.700000+35.0, "_");
  136. TextDrawFont(BigLines[6], TEXT_DRAW_FONT_MODEL_PREVIEW);
  137. TextDrawBackgroundColor(BigLines[6], 0x00000000);
  138. TextDrawSetPreviewModel(BigLines[6], 19449);
  139. TextDrawTextSize(BigLines[6], 14.0, 14.0);
  140. TextDrawSetPreviewRot(BigLines[6], 0.0, -84.0, 90.0, 1);
  141. TextDrawColor(BigLines[6], 0xBDBD00FF);
  142. TextDrawAlignment(BigLines[6], 1);
  143.  
  144.  
  145. BigLines[7] = TextDrawCreate(525.000000, 225.500000+35.0, "_");
  146. TextDrawFont(BigLines[7], TEXT_DRAW_FONT_MODEL_PREVIEW);
  147. TextDrawBackgroundColor(BigLines[7], 0x00000000);
  148. TextDrawSetPreviewModel(BigLines[7], 19449);
  149. TextDrawTextSize(BigLines[7], 14.0, 14.0);
  150. TextDrawSetPreviewRot(BigLines[7], 0.0, -105.0, 90.0, 1);
  151. TextDrawColor(BigLines[7], 0xBDBD00FF);
  152. TextDrawAlignment(BigLines[7], 1);
  153.  
  154.  
  155. BigLines[8] = TextDrawCreate(549.300000, 238.800000+35.0, "_");
  156. TextDrawFont(BigLines[8], TEXT_DRAW_FONT_MODEL_PREVIEW);
  157. TextDrawBackgroundColor(BigLines[8], 0x00000000);
  158. TextDrawSetPreviewModel(BigLines[8], 19449);
  159. TextDrawTextSize(BigLines[8], 14.0, 14.0);
  160. TextDrawSetPreviewRot(BigLines[8], 0.0, -126.0, 90.0, 1);
  161. TextDrawColor(BigLines[8], 0xBDBD00FF);
  162. TextDrawAlignment(BigLines[8], 1);
  163.  
  164.  
  165. BigLines[9] = TextDrawCreate(567.000000, 259.000000+35.0, "_");
  166. TextDrawFont(BigLines[9], TEXT_DRAW_FONT_MODEL_PREVIEW);
  167. TextDrawBackgroundColor(BigLines[9], 0x00000000);
  168. TextDrawSetPreviewModel(BigLines[9], 19449);
  169. TextDrawTextSize(BigLines[9], 14.0, 14.0);
  170. TextDrawSetPreviewRot(BigLines[9], 0.0, -147.0, 90.0, 1);
  171. TextDrawColor(BigLines[9], 0xBDBD00FF);
  172. TextDrawAlignment(BigLines[9], 1);
  173.  
  174.  
  175. BigLines[10] = TextDrawCreate(576.700000, 283.600000+35.0, "_");
  176. TextDrawFont(BigLines[10], TEXT_DRAW_FONT_MODEL_PREVIEW);
  177. TextDrawBackgroundColor(BigLines[10], 0x00000000);
  178. TextDrawSetPreviewModel(BigLines[10], 19449);
  179. TextDrawTextSize(BigLines[10], 14.0, 14.0);
  180. TextDrawSetPreviewRot(BigLines[10], 0.0, -168.0, 90.0, 1);
  181. TextDrawColor(BigLines[10], 0xA00000FF);
  182. TextDrawAlignment(BigLines[10], 1);
  183.  
  184.  
  185. BigLines[11] = TextDrawCreate(577.200000, 310.200000+35.0, "_");
  186. TextDrawFont(BigLines[11], TEXT_DRAW_FONT_MODEL_PREVIEW);
  187. TextDrawBackgroundColor(BigLines[11], 0x00000000);
  188. TextDrawSetPreviewModel(BigLines[11], 19449);
  189. TextDrawTextSize(BigLines[11], 14.0, 14.0);
  190. TextDrawSetPreviewRot(BigLines[11], 0.0, -189.0, 90.0, 1);
  191. TextDrawColor(BigLines[11], 0xA00000FF);
  192. TextDrawAlignment(BigLines[11], 1);
  193.  
  194.  
  195. BigLines[12] = TextDrawCreate(570.500000, 335.700000+35.0, "_");
  196. TextDrawFont(BigLines[12], TEXT_DRAW_FONT_MODEL_PREVIEW);
  197. TextDrawBackgroundColor(BigLines[12], 0x00000000);
  198. TextDrawSetPreviewModel(BigLines[12], 19449);
  199. TextDrawTextSize(BigLines[12], 14.0, 14.0);
  200. TextDrawSetPreviewRot(BigLines[12], 0.0, -210.0, 90.0, 1);
  201. TextDrawColor(BigLines[12], 0xA00000FF);
  202. TextDrawAlignment(BigLines[12], 1);
  203.  
  204.  
  205. BigLines[13] = TextDrawCreate(554.500000, 357.200000+35.0, "_");
  206. TextDrawFont(BigLines[13], TEXT_DRAW_FONT_MODEL_PREVIEW);
  207. TextDrawBackgroundColor(BigLines[13], 0x00000000);
  208. TextDrawSetPreviewModel(BigLines[13], 19449);
  209. TextDrawTextSize(BigLines[13], 14.0, 14.0);
  210. TextDrawSetPreviewRot(BigLines[13], 0.0, -231.0, 90.0, 1);
  211. TextDrawColor(BigLines[13], 0xA00000FF);
  212. TextDrawAlignment(BigLines[13], 1);
  213.  
  214. MPH[0] = TextDrawCreate(458.500000, 338.700000+35.0, "0");
  215. TextDrawFont(MPH[0], 2);
  216. TextDrawBackgroundColor(MPH[0], 0x00000000);
  217. TextDrawTextSize(MPH[0], 14.0, 14.0);
  218. TextDrawColor(MPH[0], 0x80ff02FF);
  219. TextDrawLetterSize(MPH[0], 0.33, 1.60);
  220.  
  221. MPH[1] = TextDrawCreate(450.700000, 320.200000+35.0, "20");
  222. TextDrawFont(MPH[1], 2);
  223. TextDrawBackgroundColor(MPH[1], 0x00000000);
  224. TextDrawTextSize(MPH[1], 14.0, 14.0);
  225. TextDrawColor(MPH[1], 0x80ff02FF);
  226. TextDrawLetterSize(MPH[1], 0.33, 1.60);
  227.  
  228.  
  229. MPH[2] = TextDrawCreate(447.000000, 298.800000+35.0, "40");
  230. TextDrawFont(MPH[2], 2);
  231. TextDrawBackgroundColor(MPH[2], 0x00000000);
  232. TextDrawTextSize(MPH[2], 14.0, 14.0);
  233. TextDrawColor(MPH[2], 0x80ff02FF);
  234. TextDrawLetterSize(MPH[2], 0.33, 1.60);
  235.  
  236.  
  237. MPH[3] = TextDrawCreate(450.000000, 276.800000+35.0, "60");
  238. TextDrawFont(MPH[3], 2);
  239. TextDrawBackgroundColor(MPH[3], 0x00000000);
  240. TextDrawTextSize(MPH[3], 14.0, 14.0);
  241. TextDrawColor(MPH[3], 0x80ff02FF);
  242. TextDrawLetterSize(MPH[3], 0.33, 1.60);
  243.  
  244.  
  245. MPH[4] = TextDrawCreate(461.400000, 258.000000+35.0, "80");
  246. TextDrawFont(MPH[4], 2);
  247. TextDrawBackgroundColor(MPH[4], 0x00000000);
  248. TextDrawTextSize(MPH[4], 14.0, 14.0);
  249. TextDrawColor(MPH[4], 0x80ff02FF);
  250. TextDrawLetterSize(MPH[4], 0.27, 1.60);
  251.  
  252. MPH[5] = TextDrawCreate(475.400000, 243.900000+35.0, "100");
  253. TextDrawFont(MPH[5], 2);
  254. TextDrawBackgroundColor(MPH[5], 0x00000000);
  255. TextDrawTextSize(MPH[5], 14.0, 14.0);
  256. TextDrawColor(MPH[5], 0xFBFB00FF);
  257. TextDrawLetterSize(MPH[5], 0.27, 1.60);
  258.  
  259. MPH[6] = TextDrawCreate(497.400000, 235.000000+35.0, "120");
  260. TextDrawFont(MPH[6], 2);
  261. TextDrawBackgroundColor(MPH[6], 0x00000000);
  262. TextDrawTextSize(MPH[6], 14.0, 14.0);
  263. TextDrawColor(MPH[6], 0xFBFB00FF);
  264. TextDrawLetterSize(MPH[6], 0.27, 1.60);
  265.  
  266. MPH[7] = TextDrawCreate(521.400000, 237.000000+35.0, "140");
  267. TextDrawFont(MPH[7], 2);
  268. TextDrawBackgroundColor(MPH[7], 0x00000000);
  269. TextDrawTextSize(MPH[7], 14.0, 14.0);
  270. TextDrawColor(MPH[7], 0xFBFB00FF);
  271. TextDrawLetterSize(MPH[7], 0.27, 1.60);
  272.  
  273. MPH[8] = TextDrawCreate(540.000000, 250.000000+35.0, "160");
  274. TextDrawFont(MPH[8], 2);
  275. TextDrawBackgroundColor(MPH[8], 0x00000000);
  276. TextDrawTextSize(MPH[8], 14.0, 14.0);
  277. TextDrawColor(MPH[8], 0xFBFB00FF);
  278. TextDrawLetterSize(MPH[8], 0.27, 1.60);
  279.  
  280. MPH[9] = TextDrawCreate(551.000000, 266.000000+35.0, "180");
  281. TextDrawFont(MPH[9], 2);
  282. TextDrawBackgroundColor(MPH[9], 0x00000000);
  283. TextDrawTextSize(MPH[9], 14.0, 14.0);
  284. TextDrawColor(MPH[9], 0xFBFB00FF);
  285. TextDrawLetterSize(MPH[9], 0.27, 1.60);
  286.  
  287. MPH[10] = TextDrawCreate(558.300000, 284.700000+35.0, "200");
  288. TextDrawFont(MPH[10], 2);
  289. TextDrawBackgroundColor(MPH[10], 0x00000000);
  290. TextDrawTextSize(MPH[10], 14.0, 14.0);
  291. TextDrawColor(MPH[10], 0xE50000FF);
  292. TextDrawLetterSize(MPH[10], 0.27, 1.60);
  293.  
  294. MPH[11] = TextDrawCreate(556.500000, 307.000000+35.0, "220");
  295. TextDrawFont(MPH[11], 2);
  296. TextDrawBackgroundColor(MPH[11], 0x00000000);
  297. TextDrawTextSize(MPH[11], 14.0, 14.0);
  298. TextDrawColor(MPH[11], 0xE50000FF);
  299. TextDrawLetterSize(MPH[11], 0.27, 1.60);
  300.  
  301. MPH[12] = TextDrawCreate(551.800000, 327.000000+35.0, "240");
  302. TextDrawFont(MPH[12], 2);
  303. TextDrawBackgroundColor(MPH[12], 0x00000000);
  304. TextDrawTextSize(MPH[12], 14.0, 14.0);
  305. TextDrawColor(MPH[12], 0xE50000FF);
  306. TextDrawLetterSize(MPH[12], 0.27, 1.60);
  307.  
  308. MPH[13] = TextDrawCreate(545.800000, 345.000000+35.0, "260");
  309. TextDrawFont(MPH[13], 2);
  310. TextDrawBackgroundColor(MPH[13], 0x00000000);
  311. TextDrawTextSize(MPH[13], 14.0, 14.0);
  312. TextDrawColor(MPH[13], 0xE50000FF);
  313. TextDrawLetterSize(MPH[13], 0.27, 1.60);
  314.  
  315. MPHT = TextDrawCreate(500.00000, 359.500000+35.0, "Km/h");
  316. TextDrawFont(MPHT, 2);
  317. TextDrawBackgroundColor(MPHT, 0x00000000);
  318. TextDrawTextSize(MPHT, 14.0, 14.0);
  319. TextDrawColor(MPHT, 0x80ff02FF);
  320. TextDrawLetterSize(MPHT, 0.29, 1.60);
  321.  
  322. SmallLines[0] = TextDrawCreate(440.400000, 339.000000+35.0, "_");
  323. TextDrawFont(SmallLines[0], TEXT_DRAW_FONT_MODEL_PREVIEW);
  324. TextDrawBackgroundColor(SmallLines[0], 0x00000000);
  325. TextDrawSetPreviewModel(SmallLines[0], 19449);
  326. TextDrawTextSize(SmallLines[0], 14.0, 14.0);
  327. TextDrawSetPreviewRot(SmallLines[0], 0.0, 30.5, 90.0, 1.5);
  328. TextDrawColor(SmallLines[0], 0x0C860CFF);
  329. TextDrawAlignment(SmallLines[0], 1);
  330.  
  331.  
  332. SmallLines[1] = TextDrawCreate(431.600000, 313.500000+35.0, "_");
  333. TextDrawFont(SmallLines[1], TEXT_DRAW_FONT_MODEL_PREVIEW);
  334. TextDrawBackgroundColor(SmallLines[1], 0x00000000);
  335. TextDrawSetPreviewModel(SmallLines[1], 19449);
  336. TextDrawTextSize(SmallLines[1], 14.0, 14.0);
  337. TextDrawSetPreviewRot(SmallLines[1], 0.0, 10.0, 90.0, 1.5);
  338. TextDrawColor(SmallLines[1], 0x0C860CFF);
  339. TextDrawAlignment(SmallLines[1], 1);
  340.  
  341. SmallLines[2] = TextDrawCreate(431.700000, 286.500000+35.0, "_");
  342. TextDrawFont(SmallLines[2], TEXT_DRAW_FONT_MODEL_PREVIEW);
  343. TextDrawBackgroundColor(SmallLines[2], 0x00000000);
  344. TextDrawSetPreviewModel(SmallLines[2], 19449);
  345. TextDrawTextSize(SmallLines[2], 14.0, 14.0);
  346. TextDrawSetPreviewRot(SmallLines[2], 0.0, -11.0, 90.0, 1.5);
  347. TextDrawColor(SmallLines[2], 0x0C860CFF);
  348. TextDrawAlignment(SmallLines[2], 1);
  349.  
  350.  
  351. SmallLines[3] = TextDrawCreate(440.800000, 261.100000+35.0, "_");
  352. TextDrawFont(SmallLines[3], TEXT_DRAW_FONT_MODEL_PREVIEW);
  353. TextDrawBackgroundColor(SmallLines[3], 0x00000000);
  354. TextDrawSetPreviewModel(SmallLines[3], 19449);
  355. TextDrawTextSize(SmallLines[3], 14.0, 14.0);
  356. TextDrawSetPreviewRot(SmallLines[3], 0.0, -32.0, 90.0, 1.5);
  357. TextDrawColor(SmallLines[3], 0x0C860CFF);
  358. TextDrawAlignment(SmallLines[3], 1);
  359.  
  360.  
  361. SmallLines[4] = TextDrawCreate(458.700000, 239.000000+35.0, "_");
  362. TextDrawFont(SmallLines[4], TEXT_DRAW_FONT_MODEL_PREVIEW);
  363. TextDrawBackgroundColor(SmallLines[4], 0x00000000);
  364. TextDrawSetPreviewModel(SmallLines[4], 19449);
  365. TextDrawTextSize(SmallLines[4], 14.0, 14.0);
  366. TextDrawSetPreviewRot(SmallLines[4], 0.0, -53.0, 90.0, 1.5);
  367. TextDrawColor(SmallLines[4], 0x0C860CFF);
  368. TextDrawAlignment(SmallLines[4], 1);
  369.  
  370.  
  371. SmallLines[5] = TextDrawCreate(482.700000, 224.700000+35.0, "_");
  372. TextDrawFont(SmallLines[5], TEXT_DRAW_FONT_MODEL_PREVIEW);
  373. TextDrawBackgroundColor(SmallLines[5], 0x00000000);
  374. TextDrawSetPreviewModel(SmallLines[5], 19449);
  375. TextDrawTextSize(SmallLines[5], 14.0, 14.0);
  376. TextDrawSetPreviewRot(SmallLines[5], 0.0, -74.0, 90.0, 1.5);
  377. TextDrawColor(SmallLines[5], 0xBDBD00FF);
  378. TextDrawAlignment(SmallLines[5], 1);
  379.  
  380.  
  381. SmallLines[6] = TextDrawCreate(511.000000, 221.300000+35.0, "_");
  382. TextDrawFont(SmallLines[6], TEXT_DRAW_FONT_MODEL_PREVIEW);
  383. TextDrawBackgroundColor(SmallLines[6], 0x00000000);
  384. TextDrawSetPreviewModel(SmallLines[6], 19449);
  385. TextDrawTextSize(SmallLines[6], 14.0, 14.0);
  386. TextDrawSetPreviewRot(SmallLines[6], 0.0, -95.0, 90.0, 1.5);
  387. TextDrawColor(SmallLines[6], 0xBDBD00FF);
  388. TextDrawAlignment(SmallLines[6], 1);
  389.  
  390.  
  391. SmallLines[7] = TextDrawCreate(538.500000, 229.200000+35.0, "_");
  392. TextDrawFont(SmallLines[7], TEXT_DRAW_FONT_MODEL_PREVIEW);
  393. TextDrawBackgroundColor(SmallLines[7], 0x00000000);
  394. TextDrawSetPreviewModel(SmallLines[7], 19449);
  395. TextDrawTextSize(SmallLines[7], 14.0, 14.0);
  396. TextDrawSetPreviewRot(SmallLines[7], 0.0, -116.0, 90.0, 1.5);
  397. TextDrawColor(SmallLines[7], 0xBDBD00FF);
  398. TextDrawAlignment(SmallLines[7], 1);
  399.  
  400.  
  401. SmallLines[8] = TextDrawCreate(560.500000, 246.700000+35.0, "_");
  402. TextDrawFont(SmallLines[8], TEXT_DRAW_FONT_MODEL_PREVIEW);
  403. TextDrawBackgroundColor(SmallLines[8], 0x00000000);
  404. TextDrawSetPreviewModel(SmallLines[8], 19449);
  405. TextDrawTextSize(SmallLines[8], 14.0, 14.0);
  406. TextDrawSetPreviewRot(SmallLines[8], 0.0, -137.0, 90.0, 1.5);
  407. TextDrawColor(SmallLines[8], 0xBDBD00FF);
  408. TextDrawAlignment(SmallLines[8], 1);
  409.  
  410.  
  411. SmallLines[9] = TextDrawCreate(575.000000, 270.200000+35.0, "_");
  412. TextDrawFont(SmallLines[9], TEXT_DRAW_FONT_MODEL_PREVIEW);
  413. TextDrawBackgroundColor(SmallLines[9], 0x00000000);
  414. TextDrawSetPreviewModel(SmallLines[9], 19449);
  415. TextDrawTextSize(SmallLines[9], 14.0, 14.0);
  416. TextDrawSetPreviewRot(SmallLines[9], 0.0, -158.0, 90.0, 1.5);
  417. TextDrawColor(SmallLines[9], 0xBDBD00FF);
  418. TextDrawAlignment(SmallLines[9], 1);
  419.  
  420.  
  421. SmallLines[10] = TextDrawCreate(580.000000, 296.700000+35.0, "_");
  422. TextDrawFont(SmallLines[10], TEXT_DRAW_FONT_MODEL_PREVIEW);
  423. TextDrawBackgroundColor(SmallLines[10], 0x00000000);
  424. TextDrawSetPreviewModel(SmallLines[10], 19449);
  425. TextDrawTextSize(SmallLines[10], 14.0, 14.0);
  426. TextDrawSetPreviewRot(SmallLines[10], 0.0, -179.0, 90.0, 1.5);
  427. TextDrawColor(SmallLines[10], 0xA00000FF);
  428. TextDrawAlignment(SmallLines[10], 1);
  429.  
  430.  
  431. SmallLines[11] = TextDrawCreate(576.800000, 323.500000+35.0, "_");
  432. TextDrawFont(SmallLines[11], TEXT_DRAW_FONT_MODEL_PREVIEW);
  433. TextDrawBackgroundColor(SmallLines[11], 0x00000000);
  434. TextDrawSetPreviewModel(SmallLines[11], 19449);
  435. TextDrawTextSize(SmallLines[11], 14.0, 14.0);
  436. TextDrawSetPreviewRot(SmallLines[11], 0.0, -200.0, 90.0, 1.5);
  437. TextDrawColor(SmallLines[11], 0xA00000FF);
  438. TextDrawAlignment(SmallLines[11], 1);
  439.  
  440.  
  441. SmallLines[12] = TextDrawCreate(565.000000, 348.000000+35.0, "_");
  442. TextDrawFont(SmallLines[12], TEXT_DRAW_FONT_MODEL_PREVIEW);
  443. TextDrawBackgroundColor(SmallLines[12], 0x00000000);
  444. TextDrawSetPreviewModel(SmallLines[12], 19449);
  445. TextDrawTextSize(SmallLines[12], 14.0, 14.0);
  446. TextDrawSetPreviewRot(SmallLines[12], 0.0, -221.0, 90.0, 1.5);
  447. TextDrawColor(SmallLines[12], 0xA00000FF);
  448. TextDrawAlignment(SmallLines[12], 1);
  449.  
  450. GearBox0 = TextDrawCreate(484.000000, 366.000000, "_");
  451. TextDrawBackgroundColor(GearBox0, 255);
  452. TextDrawFont(GearBox0, 1);
  453. TextDrawLetterSize(GearBox0, 0.479999, 2.400000);
  454. TextDrawColor(GearBox0, -1);
  455. TextDrawSetOutline(GearBox0, 0);
  456. TextDrawSetProportional(GearBox0, 1);
  457. TextDrawSetShadow(GearBox0, 1);
  458. TextDrawUseBox(GearBox0, 1);
  459. TextDrawBoxColor(GearBox0, -1886416897);
  460. TextDrawTextSize(GearBox0, 541.000000, 0.000000);
  461. TextDrawSetSelectable(GearBox0, 0);
  462.  
  463. GearBox1 = TextDrawCreate(485.000000, 368.000000, "_");
  464. TextDrawBackgroundColor(GearBox1, 255);
  465. TextDrawFont(GearBox1, 1);
  466. TextDrawLetterSize(GearBox1, 0.500000, 1.999999);
  467. TextDrawColor(GearBox1, -1);
  468. TextDrawSetOutline(GearBox1, 0);
  469. TextDrawSetProportional(GearBox1, 1);
  470. TextDrawSetShadow(GearBox1, 1);
  471. TextDrawUseBox(GearBox1, 1);
  472. TextDrawBoxColor(GearBox1, 1364283903);
  473. TextDrawTextSize(GearBox1, 539.000000, 0.000000);
  474. TextDrawSetSelectable(GearBox1, 0);
  475.  
  476.  
  477.  
  478. SpeedBox0 = TextDrawCreate(501.000000, 312.000000, "_");
  479. TextDrawBackgroundColor(SpeedBox0, 255);
  480. TextDrawFont(SpeedBox0, 1);
  481. TextDrawLetterSize(SpeedBox0, 0.500000, 1.200000);
  482. TextDrawColor(SpeedBox0, -1);
  483. TextDrawSetOutline(SpeedBox0, 0);
  484. TextDrawSetProportional(SpeedBox0, 1);
  485. TextDrawSetShadow(SpeedBox0, 1);
  486. TextDrawUseBox(SpeedBox0, 1);
  487. TextDrawBoxColor(SpeedBox0, -1886416897);
  488. TextDrawTextSize(SpeedBox0, 524.000000, 0.000000);
  489. TextDrawSetSelectable(SpeedBox0, 0);
  490.  
  491. SpeedBox1 = TextDrawCreate(502.000000, 313.000000, "_");
  492. TextDrawBackgroundColor(SpeedBox1, 255);
  493. TextDrawFont(SpeedBox1, 1);
  494. TextDrawLetterSize(SpeedBox1, 0.500000, 1.000000);
  495. TextDrawColor(SpeedBox1, -1);
  496. TextDrawSetOutline(SpeedBox1, 0);
  497. TextDrawSetProportional(SpeedBox1, 1);
  498. TextDrawSetShadow(SpeedBox1, 1);
  499. TextDrawUseBox(SpeedBox1, 1);
  500. TextDrawBoxColor(SpeedBox1, 1364283903);
  501. TextDrawTextSize(SpeedBox1, 522.000000, 0.000000);
  502. TextDrawSetSelectable(SpeedBox1, 0);
  503.  
  504. Shade0 = TextDrawCreate(485.000000, 368.000000, "_");
  505. TextDrawBackgroundColor(Shade0, 255);
  506. TextDrawFont(Shade0, 1);
  507. TextDrawLetterSize(Shade0, 0.500000, 0.099999);
  508. TextDrawColor(Shade0, -1);
  509. TextDrawSetOutline(Shade0, 0);
  510. TextDrawSetProportional(Shade0, 1);
  511. TextDrawSetShadow(Shade0, 1);
  512. TextDrawUseBox(Shade0, 1);
  513. TextDrawBoxColor(Shade0, 102);
  514. TextDrawTextSize(Shade0, 539.000000, 0.000000);
  515. TextDrawSetSelectable(Shade0, 0);
  516.  
  517. Shade1 = TextDrawCreate(502.000000, 313.000000, "_");
  518. TextDrawBackgroundColor(Shade1, 255);
  519. TextDrawFont(Shade1, 1);
  520. TextDrawLetterSize(Shade1, 0.460000, 0.000000);
  521. TextDrawColor(Shade1, -1);
  522. TextDrawSetOutline(Shade1, 0);
  523. TextDrawSetProportional(Shade1, 1);
  524. TextDrawSetShadow(Shade1, 1);
  525. TextDrawUseBox(Shade1, 1);
  526. TextDrawBoxColor(Shade1, 102);
  527. TextDrawTextSize(Shade1, 522.000000, 0.000000);
  528. TextDrawSetSelectable(Shade1, 0);
  529.  
  530.  
  531.  
  532.  
  533. return 1;
  534. }
  535.  
  536. public OnFilterScriptExit()
  537. {
  538.  
  539. TextDrawDestroy(speedo1);
  540. TextDrawDestroy(Circles[0]);
  541. TextDrawDestroy(Circles[1]);
  542. TextDrawDestroy(Circles[2]);
  543. TextDrawDestroy(Circles[3]);
  544. for(new i=0; i<14; i++)
  545. {
  546. TextDrawDestroy(BigLines[i]);
  547. }
  548. for(new i=0; i<14; i++)
  549. {
  550. TextDrawDestroy(MPH[i]);
  551. }
  552.  
  553. TextDrawDestroy(MPHT);
  554. for(new i=0; i<13; i++)
  555. {
  556. TextDrawDestroy(SmallLines[i]);
  557. }
  558. TextDrawDestroy(GearBox0);
  559. TextDrawDestroy(GearBox1);
  560. TextDrawDestroy(SpeedBox0);
  561. TextDrawDestroy(SpeedBox1);
  562. TextDrawDestroy(Shade1);
  563. TextDrawDestroy(Shade0);
  564. return 1;
  565. }
  566.  
  567.  
  568. stock GetVehicleSpeed(playerid)
  569. {
  570. new Float:p[3];
  571. new Float:final_speed,final_speed_int;
  572. GetVehicleVelocity(GetPlayerVehicleID(playerid),p[0],p[1],p[2]);
  573. final_speed = floatsqroot(((p[0]*p[0])+(p[1]*p[1]))+(p[2]*p[2]))*181.1166672; // 250.666667 = kmph // 199,4166672= mph
  574. final_speed_int = floatround(final_speed,floatround_round);
  575. if(IsVehicleDrivingBackwards(playerid))
  576. {
  577. final_speed_int=0;
  578. }
  579. return final_speed_int;
  580. }
  581. public OnPlayerRequestClass(playerid, classid)
  582. {
  583. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  584. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  585. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  586. return 1;
  587. }
  588.  
  589. public OnPlayerConnect(playerid)
  590. {
  591. Speed[playerid] = CreatePlayerTextDraw(playerid,542.000000, 365.000000, "999");
  592. PlayerTextDrawAlignment(playerid,Speed[playerid], 3);
  593. PlayerTextDrawBackgroundColor(playerid,Speed[playerid], -1);
  594. PlayerTextDrawFont(playerid,Speed[playerid], 3);
  595. PlayerTextDrawLetterSize(playerid,Speed[playerid], 0.949998, 2.400000);
  596. PlayerTextDrawColor(playerid,Speed[playerid], 255);
  597. PlayerTextDrawSetOutline(playerid,Speed[playerid], 0);
  598. PlayerTextDrawSetProportional(playerid,Speed[playerid], 0);
  599. PlayerTextDrawSetShadow(playerid,Speed[playerid], 0);
  600. PlayerTextDrawSetSelectable(playerid,Speed[playerid], 0);
  601.  
  602. Gear[playerid] = CreatePlayerTextDraw(playerid,510.000000, 308.000000, "N");
  603. PlayerTextDrawBackgroundColor(playerid,Gear[playerid], 255);
  604. PlayerTextDrawFont(playerid,Gear[playerid], 2);
  605. PlayerTextDrawLetterSize(playerid,Gear[playerid], 0.500000, 1.800000);
  606. PlayerTextDrawColor(playerid,Gear[playerid], 85);
  607. PlayerTextDrawSetOutline(playerid,Gear[playerid], 0);
  608. PlayerTextDrawSetProportional(playerid,Gear[playerid], 1);
  609. PlayerTextDrawSetShadow(playerid,Gear[playerid], 1);
  610. PlayerTextDrawSetSelectable(playerid,Gear[playerid], 0);
  611.  
  612.  
  613. new Float:rotation = 309;
  614. for(new q = 8; q >= 0; q--)
  615. {
  616. new Float:Pos[9][2];
  617. RotationXY(508.6, 325+35.0, Pos[q][0], Pos[q][1], rotation, (q + 1) * 8);
  618. needle[playerid][q] = CreatePlayerTextDraw(playerid, Pos[q][0], Pos[q][1], ".");
  619. PlayerTextDrawColor(playerid, needle[playerid][q], 0xb00000FF);
  620. PlayerTextDrawLetterSize(playerid, needle[playerid][q], 0.73, -2.60);
  621. PlayerTextDrawSetOutline(playerid, needle[playerid][q], 0);
  622. PlayerTextDrawBackgroundColor(playerid, needle[playerid][q], 0xa00000FF);
  623. PlayerTextDrawSetOutline(playerid, needle[playerid][q], 1);
  624.  
  625. }
  626. new Float:alpha2 = rotation - 180;
  627. for(new x; x < 4; x++)
  628. {
  629. new Float:Pos1[4][2];
  630. RotationXY(508.6, 325+35.0, Pos1[x][0], Pos1[x][1], alpha2, (x + 1) * 5);
  631. Backneedle[playerid][x] = CreatePlayerTextDraw(playerid, Pos1[x][0], Pos1[x][1], "~l~.");
  632. PlayerTextDrawBackgroundColor(playerid, Backneedle[playerid][x], 0x000000FF);
  633. PlayerTextDrawLetterSize(playerid, Backneedle[playerid][x], 0.73, -2.60);
  634. PlayerTextDrawColor(playerid, Backneedle[playerid][x], 0x000000FF);
  635. PlayerTextDrawSetOutline(playerid, Backneedle[playerid][x], 1);
  636.  
  637. }
  638. speedo2[playerid] = CreatePlayerTextDraw(playerid, 430.000000, 220.000000+35.0, "_");
  639. PlayerTextDrawFont(playerid, speedo2[playerid], TEXT_DRAW_FONT_MODEL_PREVIEW);
  640. PlayerTextDrawBackgroundColor(playerid, speedo2[playerid], 0x00000000);
  641. PlayerTextDrawSetPreviewModel(playerid, speedo2[playerid], 19159);
  642. PlayerTextDrawTextSize(playerid, speedo2[playerid], 165.0, 175.0);
  643. PlayerTextDrawSetPreviewRot(playerid, speedo2[playerid], 90.0, 0.0, 0.0, 4.2);
  644. PlayerTextDrawColor(playerid, speedo2[playerid], 0x000000FF);
  645. return 1;
  646. }
  647.  
  648. public OnPlayerDisconnect(playerid, reason)
  649. {
  650. PlayerTextDrawDestroy(playerid, speedo2[playerid]);
  651. for(new i=0; i<4; i++)
  652. {
  653. PlayerTextDrawDestroy(playerid, Backneedle[playerid][i]);
  654. }
  655. PlayerTextDrawDestroy(playerid, Speed[playerid]);
  656. for(new i=0; i<9; i++)
  657. {
  658. PlayerTextDrawDestroy(playerid, needle[playerid][i]);
  659. }
  660. PlayerTextDrawDestroy(playerid, Gear[playerid]);
  661. return 1;
  662. }
  663.  
  664. public OnPlayerDeath(playerid, killerid, reason)
  665. {
  666. if(IsPlayerInAnyVehicle(playerid))
  667. {
  668. PlayerTextDrawHide(playerid, speedo2[playerid]);
  669. TextDrawHideForPlayer(playerid, speedo1);
  670. TextDrawHideForPlayer(playerid, Circles[0]);
  671. TextDrawHideForPlayer(playerid, Circles[1]);
  672. TextDrawHideForPlayer(playerid, Circles[2]);
  673. TextDrawHideForPlayer(playerid, Circles[3]);
  674. for(new i=0; i<14; i++)
  675. {
  676. TextDrawHideForPlayer(playerid, BigLines[i]);
  677. }
  678. for(new i=0; i<14; i++)
  679. {
  680. TextDrawHideForPlayer(playerid, MPH[i]);
  681. }
  682. for(new i=0; i<4; i++)
  683. {
  684. PlayerTextDrawHide(playerid, Backneedle[playerid][i]);
  685. }
  686. TextDrawHideForPlayer(playerid, MPHT);
  687. for(new i=0; i<13; i++)
  688. {
  689. TextDrawHideForPlayer(playerid, SmallLines[i]);
  690. }
  691. TextDrawHideForPlayer(playerid, GearBox0);
  692. TextDrawHideForPlayer(playerid, GearBox1);
  693. TextDrawHideForPlayer(playerid, SpeedBox0);
  694. TextDrawHideForPlayer(playerid, SpeedBox1);
  695. PlayerTextDrawHide(playerid, Speed[playerid]);
  696. for(new i=0; i<9; i++)
  697. {
  698. PlayerTextDrawHide(playerid, needle[playerid][i]);
  699. }
  700. PlayerTextDrawHide(playerid, Gear[playerid]);
  701. TextDrawHideForPlayer(playerid, Shade1);
  702. TextDrawHideForPlayer(playerid, Shade0);
  703. }
  704. return 1;
  705. }
  706.  
  707. public OnPlayerStateChange(playerid, newstate, oldstate)
  708. {
  709. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
  710. {
  711. PlayerTextDrawShow(playerid, speedo2[playerid]);
  712. TextDrawShowForPlayer(playerid, speedo1);
  713. TextDrawShowForPlayer(playerid, Circles[0]);
  714. TextDrawShowForPlayer(playerid, Circles[1]);
  715. TextDrawShowForPlayer(playerid, Circles[2]);
  716. TextDrawShowForPlayer(playerid, Circles[3]);
  717. for(new i=0; i<14; i++)
  718. {
  719. TextDrawShowForPlayer(playerid, BigLines[i]);
  720. }
  721. for(new i=0; i<14; i++)
  722. {
  723. TextDrawShowForPlayer(playerid, MPH[i]);
  724. }
  725. TextDrawShowForPlayer(playerid, MPHT);
  726. for(new i=0; i<13; i++)
  727. {
  728. TextDrawShowForPlayer(playerid, SmallLines[i]);
  729. }
  730. TextDrawShowForPlayer(playerid, GearBox0);
  731. TextDrawShowForPlayer(playerid, GearBox1);
  732. TextDrawShowForPlayer(playerid, SpeedBox0);
  733. TextDrawShowForPlayer(playerid, SpeedBox1);
  734. PlayerTextDrawShow(playerid, Speed[playerid]);
  735. PlayerTextDrawShow(playerid, Gear[playerid]);
  736. TextDrawShowForPlayer(playerid, Shade1);
  737. for(new i=0; i<9; i++)
  738. {
  739. PlayerTextDrawShow(playerid, needle[playerid][i]);
  740. }
  741. for(new i=0; i<4; i++)
  742. {
  743. PlayerTextDrawShow(playerid, Backneedle[playerid][i]);
  744. }
  745. TextDrawShowForPlayer(playerid, Shade0);
  746. }
  747. if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
  748. {
  749. PlayerTextDrawHide(playerid, speedo2[playerid]);
  750. TextDrawHideForPlayer(playerid, speedo1);
  751. TextDrawHideForPlayer(playerid, Circles[0]);
  752. TextDrawHideForPlayer(playerid, Circles[1]);
  753. TextDrawHideForPlayer(playerid, Circles[2]);
  754. TextDrawHideForPlayer(playerid, Circles[3]);
  755. for(new i=0; i<14; i++)
  756. {
  757. TextDrawHideForPlayer(playerid, BigLines[i]);
  758. }
  759. for(new i=0; i<14; i++)
  760. {
  761. TextDrawHideForPlayer(playerid, MPH[i]);
  762. }
  763. for(new i=0; i<4; i++)
  764. {
  765. PlayerTextDrawHide(playerid, Backneedle[playerid][i]);
  766. }
  767. TextDrawHideForPlayer(playerid, MPHT);
  768. for(new i=0; i<13; i++)
  769. {
  770. TextDrawHideForPlayer(playerid, SmallLines[i]);
  771. }
  772. TextDrawHideForPlayer(playerid, GearBox0);
  773. TextDrawHideForPlayer(playerid, GearBox1);
  774. TextDrawHideForPlayer(playerid, SpeedBox0);
  775. TextDrawHideForPlayer(playerid, SpeedBox1);
  776. PlayerTextDrawHide(playerid, Speed[playerid]);
  777. for(new i=0; i<9; i++)
  778. {
  779. PlayerTextDrawHide(playerid, needle[playerid][i]);
  780. }
  781. PlayerTextDrawHide(playerid, Gear[playerid]);
  782. TextDrawHideForPlayer(playerid, Shade1);
  783. TextDrawHideForPlayer(playerid, Shade0);
  784. }
  785. return 1;
  786. }
  787.  
  788. public OnPlayerUpdate(playerid)
  789. {
  790. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
  791. {
  792. if(GetPlayerVehicleSeat(playerid) == 0 || GetPlayerVehicleSeat(playerid) == 1)
  793. {
  794. new Float:Pos[9][2];
  795. new Float:alpha = 309 - GetVehicleSpeed(playerid);
  796. if(alpha < 60) alpha = 60;
  797.  
  798. for(new i; i < 9; i++)
  799. {
  800. PlayerTextDrawHide(playerid, needle[playerid][i]);
  801. PlayerTextDrawDestroy(playerid,needle[playerid][i]);
  802. RotationXY(508.6, 325+35.0, Pos[i][0], Pos[i][1], alpha, (i + 1) * 8);
  803. needle[playerid][i] = CreatePlayerTextDraw(playerid, Pos[i][0], Pos[i][1], ".");
  804. PlayerTextDrawColor(playerid, needle[playerid][i], 0xb00000FF);
  805. PlayerTextDrawLetterSize(playerid, needle[playerid][i], 0.73, -2.60);
  806. PlayerTextDrawSetOutline(playerid, needle[playerid][i], 0);
  807. PlayerTextDrawBackgroundColor(playerid, needle[playerid][i], 0xa00000FF);
  808. PlayerTextDrawSetOutline(playerid, needle[playerid][i], 1);
  809. PlayerTextDrawShow(playerid, needle[playerid][i]);
  810. }
  811. new Float:alpha2 = alpha - 180;
  812. for(new x; x < 4; x++)
  813. {
  814. PlayerTextDrawDestroy(playerid, Backneedle[playerid][x]);
  815. new Float:Pos1[4][2];
  816. RotationXY(508.6, 325+35.0, Pos1[x][0], Pos1[x][1], alpha2, (x + 1) * 5);
  817. Backneedle[playerid][x] = CreatePlayerTextDraw(playerid, Pos1[x][0], Pos1[x][1], "~l~.");
  818. PlayerTextDrawBackgroundColor(playerid, Backneedle[playerid][x], 0x000000FF);
  819. PlayerTextDrawLetterSize(playerid, Backneedle[playerid][x], 0.73, -2.60);
  820. PlayerTextDrawColor(playerid, Backneedle[playerid][x], 0x000000FF);
  821. PlayerTextDrawSetOutline(playerid, Backneedle[playerid][x], 1);
  822. PlayerTextDrawShow(playerid, Backneedle[playerid][x]);
  823. }
  824. if(!IsVehicleDrivingBackwards(GetPlayerVehicleID(playerid)))
  825. {
  826. new speed_string[128];
  827. format(speed_string,sizeof(speed_string),"%i",GetVehicleSpeed(playerid));
  828. PlayerTextDrawSetString(playerid, Speed[playerid], speed_string);
  829.  
  830. if(GetVehicleSpeed(playerid) < 1)
  831. {
  832. PlayerTextDrawSetString(playerid, Gear[playerid], "N");
  833. }
  834. if(GetVehicleSpeed(playerid) > 1)
  835. {
  836. PlayerTextDrawSetString(playerid, Gear[playerid], "D");
  837.  
  838. }
  839. }
  840. if(IsVehicleDrivingBackwards(GetPlayerVehicleID(playerid)))
  841. {
  842. PlayerTextDrawSetString(playerid, Gear[playerid], "R");
  843. PlayerTextDrawSetString(playerid, Speed[playerid], "0");
  844. return 1;
  845. }
  846. }
  847. }
  848. return 1;
  849. }
  850. stock IsVehicleDrivingBackwards(vehicleid)
  851. {
  852. new Float:Float[3];
  853. if(GetVehicleVelocity(vehicleid, Float[1], Float[2], Float[0]))
  854. {
  855. GetVehicleZAngle(vehicleid, Float[0]);
  856. if(Float[0] < 90)
  857. {
  858. if(Float[1] > 0 && Float[2] < 0) return true;
  859. }
  860. else if(Float[0] < 180)
  861. {
  862. if(Float[1] > 0 && Float[2] > 0) return true;
  863. }
  864. else if(Float[0] < 270)
  865. {
  866. if(Float[1] < 0 && Float[2] > 0) return true;
  867. }
  868. else if(Float[1] < 0 && Float[2] < 0) return true;
  869. }
  870. return false;
  871. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement