Guest User

Untitled

a guest
Oct 20th, 2014
1,102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.09 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new Text:Textdraw0;
  4. new Text:Textdraw1;
  5. new Text:Textdraw2;
  6. new PlayerText:Textdraw3[MAX_PLAYERS];
  7. new PlayerText:Textdraw4[MAX_PLAYERS];
  8. new PlayerText:Textdraw5[MAX_PLAYERS];
  9.  
  10.  
  11. new VehicleNames[][] =
  12. {
  13. "Landstalker",
  14. "Bravura",
  15. "Buffalo",
  16. "Linerunner",
  17. "Perenniel",
  18. "Sentinel",
  19. "Dumper",
  20. "Firetruck",
  21. "Trashmaster",
  22. "Stretch",
  23. "Manana",
  24. "Infernus",
  25. "Voodoo",
  26. "Pony",
  27. "Mule",
  28. "Cheetah",
  29. "Ambulance",
  30. "Leviathan",
  31. "Moonbeam",
  32. "Esperanto",
  33. "Taxi",
  34. "Washington",
  35. "Bobcat",
  36. "Mr Whoopee",
  37. "BF Injection",
  38. "Hunter",
  39. "Premier",
  40. "Enforcer",
  41. "Securicar",
  42. "Banshee",
  43. "Predator",
  44. "Bus",
  45. "Rhino",
  46. "Barracks",
  47. "Hotknife",
  48. "Article Trailer",
  49. "Previon",
  50. "Coach",
  51. "Cabbie",
  52. "Stallion",
  53. "Rumpo",
  54. "RC Bandit",
  55. "Romero",
  56. "Packer",
  57. "Monster",
  58. "Admiral",
  59. "Squallo",
  60. "Seasparrow",
  61. "Pizzaboy",
  62. "Tram",
  63. "Article Trailer 2",
  64. "Turismo",
  65. "Speeder",
  66. "Reefer",
  67. "Tropic",
  68. "Flatbed",
  69. "Yankee",
  70. "Caddy",
  71. "Solair",
  72. "Topfun Van (Berkley's RC)",
  73. "Skimmer",
  74. "PCJ-600",
  75. "Faggio",
  76. "Freeway",
  77. "RC Baron",
  78. "RC Raider",
  79. "Glendale",
  80. "Oceanic",
  81. "Sanchez",
  82. "Sparrow",
  83. "Patriot",
  84. "Quad",
  85. "Coastguard",
  86. "Dinghy",
  87. "Hermes",
  88. "Sabre",
  89. "Rustler",
  90. "ZR-350",
  91. "Walton",
  92. "Regina",
  93. "Comet",
  94. "BMX",
  95. "Burrito",
  96. "Camper",
  97. "Marquis",
  98. "Baggage",
  99. "Dozer",
  100. "Maverick",
  101. "SAN News Maverick",
  102. "Rancher",
  103. "FBI Racher",
  104. "Virgo",
  105. "Greenwood",
  106. "Jetmax",
  107. "Hotring Racer",
  108. "Sandking",
  109. "Blista Compact",
  110. "Police Maverick",
  111. "Boxville",
  112. "Benson",
  113. "Mesa",
  114. "RC Goblin",
  115. "Hotring Racer",
  116. "Hotring Racer",
  117. "Bloodring Banger",
  118. "Rancher",
  119. "Super GT",
  120. "Elegant",
  121. "Journey",
  122. "Bike",
  123. "Mountain Bike",
  124. "Beagle",
  125. "Cropduster",
  126. "Stuntplane",
  127. "Tanker",
  128. "Roadtrain",
  129. "Nebula",
  130. "Majestic",
  131. "Buccaneer",
  132. "Shamal",
  133. "Hydra",
  134. "FCR-900",
  135. "NRG-500",
  136. "HPV1000",
  137. "Cement Truck",
  138. "Towtruck",
  139. "Fortune",
  140. "Cadrona",
  141. "FBI Truck",
  142. "Willard",
  143. "Forklift",
  144. "Tractor",
  145. "Combine Hervester",
  146. "Feltzer",
  147. "Remington",
  148. "Slamvan",
  149. "Blade",
  150. "Freight (Train)",
  151. "Brownstreak (Train)",
  152. "Vortex",
  153. "Vincent",
  154. "Bullet",
  155. "Clover",
  156. "Sadler",
  157. "Firetruck LA",
  158. "Hustler",
  159. "Intruder",
  160. "Primo",
  161. "Cargobob",
  162. "Tampa",
  163. "Sunrise",
  164. "Merit",
  165. "Utility Van",
  166. "Nevada",
  167. "Yosemite",
  168. "Windsor",
  169. "Monster \"A\"",
  170. "Monster \"B\"",
  171. "Uranus",
  172. "Jester",
  173. "Sultan",
  174. "Stratum",
  175. "Elegy",
  176. "Raindance",
  177. "RC Tiger",
  178. "Flash",
  179. "Tahoma",
  180. "Savanna",
  181. "Bandito",
  182. "Freight Flat Tailer (Train)",
  183. "Streak Trailer (Train)",
  184. "Kart",
  185. "Mower",
  186. "Dune",
  187. "Sweeper",
  188. "Broadway",
  189. "Tornado",
  190. "AT-400",
  191. "DFT-30",
  192. "Huntley",
  193. "Stafford",
  194. "BF-400",
  195. "Newsvan",
  196. "Tug",
  197. "Petrol Trailer",
  198. "Emperor",
  199. "Wayfarer",
  200. "Euros",
  201. "Hotdog",
  202. "Club",
  203. "Freight Box Trailer (Train)",
  204. "Article Trailer 3",
  205. "Andromada",
  206. "Dodo",
  207. "RC Cam",
  208. "Launch",
  209. "Police Car (LSPD)",
  210. "Police Car (SFPD)",
  211. "Police Car (LVPD)",
  212. "Police Ranger",
  213. "Picador",
  214. "S.W.A.T.",
  215. "Alpha",
  216. "Phoenix",
  217. "Glendale Shit",
  218. "Sadler Shit",
  219. "Baggage Trailer \"A\"",
  220. "Baggage Trailer \"B\"",
  221. "Tug Stairs Trailer",
  222. "Boxville",
  223. "Farm Trailer",
  224. "Utility Trailer"
  225. };
  226. new hSpeedActiv[MAX_PLAYERS];
  227. new hspeedinfotimer[MAX_PLAYERS];
  228.  
  229. public OnFilterScriptInit()
  230. {
  231. print("- hSpeed (by Hattoldy) succesfully loaded."); // credits
  232. Textdraw0 = TextDrawCreate(602.500000, 332.522216, "usebox");
  233. TextDrawLetterSize(Textdraw0, 0.122000, 8.795476);
  234. TextDrawTextSize(Textdraw0, 485.500000, 4.355555);
  235. TextDrawAlignment(Textdraw0, 1);
  236. TextDrawColor(Textdraw0, 0);
  237. TextDrawUseBox(Textdraw0, true);
  238. TextDrawBoxColor(Textdraw0, 102);
  239. TextDrawSetShadow(Textdraw0, 0);
  240. TextDrawSetOutline(Textdraw0, 0);
  241. TextDrawFont(Textdraw0, 0);
  242.  
  243. Textdraw1 = TextDrawCreate(505.000000, 318.577758, "hud:radar_truck");
  244. TextDrawLetterSize(Textdraw1, 0.769999, 1.711111);
  245. TextDrawTextSize(Textdraw1, 23.000000, 21.155574);
  246. TextDrawAlignment(Textdraw1, 1);
  247. TextDrawColor(Textdraw1, -1);
  248. TextDrawUseBox(Textdraw1, true);
  249. TextDrawBoxColor(Textdraw1, 102);
  250. TextDrawSetShadow(Textdraw1, 0);
  251. TextDrawSetOutline(Textdraw1, 0);
  252. TextDrawFont(Textdraw1, 4);
  253.  
  254. Textdraw2 = TextDrawCreate(529.000000, 316.711090, "hSpeed");
  255. TextDrawLetterSize(Textdraw2, 0.692499, 2.160000);
  256. TextDrawAlignment(Textdraw2, 1);
  257. TextDrawColor(Textdraw2, -1);
  258. TextDrawSetShadow(Textdraw2, 0);
  259. TextDrawSetOutline(Textdraw2, 1);
  260. TextDrawBackgroundColor(Textdraw2, 51);
  261. TextDrawFont(Textdraw2, 0);
  262. TextDrawSetProportional(Textdraw2, 1);
  263. return 1;
  264. }
  265.  
  266.  
  267. public OnPlayerConnect(playerid)
  268. {
  269. Textdraw3[playerid] = CreatePlayerTextDraw(playerid, 548.500000, 392.622161, "~R~SUPER GT");
  270. PlayerTextDrawLetterSize(playerid, Textdraw3[playerid], 0.321500, 1.475554);
  271. PlayerTextDrawAlignment(playerid, Textdraw3[playerid], 2);
  272. PlayerTextDrawColor(playerid, Textdraw3[playerid], -1);
  273. PlayerTextDrawSetShadow(playerid, Textdraw3[playerid], 0);
  274. PlayerTextDrawSetOutline(playerid, Textdraw3[playerid], 1);
  275. PlayerTextDrawBackgroundColor(playerid, Textdraw3[playerid], 51);
  276. PlayerTextDrawFont(playerid, Textdraw3[playerid], 3);
  277. PlayerTextDrawSetProportional(playerid, Textdraw3[playerid], 1);
  278.  
  279. Textdraw4[playerid] = CreatePlayerTextDraw(playerid, 545.000000, 348.822143, "SPEED ~R~123 KM/H");
  280. PlayerTextDrawLetterSize(playerid, Textdraw4[playerid], 0.364500, 1.425777);
  281. PlayerTextDrawAlignment(playerid, Textdraw4[playerid], 2);
  282. PlayerTextDrawColor(playerid, Textdraw4[playerid], -1);
  283. PlayerTextDrawSetShadow(playerid, Textdraw4[playerid], 0);
  284. PlayerTextDrawSetOutline(playerid, Textdraw4[playerid], 1);
  285. PlayerTextDrawBackgroundColor(playerid, Textdraw4[playerid], 51);
  286. PlayerTextDrawFont(playerid, Textdraw4[playerid], 3);
  287. PlayerTextDrawSetProportional(playerid, Textdraw4[playerid], 1);
  288.  
  289. Textdraw5[playerid] = CreatePlayerTextDraw(playerid, 546.500000, 372.222229, "Health ~R~100.0");
  290. PlayerTextDrawLetterSize(playerid, Textdraw5[playerid], 0.367000, 1.488000);
  291. PlayerTextDrawAlignment(playerid, Textdraw5[playerid], 2);
  292. PlayerTextDrawColor(playerid, Textdraw5[playerid], -1);
  293. PlayerTextDrawSetShadow(playerid, Textdraw5[playerid], 0);
  294. PlayerTextDrawSetOutline(playerid, Textdraw5[playerid], 1);
  295. PlayerTextDrawBackgroundColor(playerid, Textdraw5[playerid], 51);
  296. PlayerTextDrawFont(playerid, Textdraw5[playerid], 3);
  297. PlayerTextDrawSetProportional(playerid, Textdraw5[playerid], 1);
  298. hSpeedActiv[playerid] = 1;
  299. return 1;
  300. }
  301.  
  302. public OnPlayerStateChange(playerid,newstate,oldstate)
  303. {
  304. if(hSpeedActiv[playerid] == 1)
  305. {
  306. if(newstate == PLAYER_STATE_DRIVER)
  307. {
  308. TextDrawShowForPlayer(playerid,Textdraw0);
  309. TextDrawShowForPlayer(playerid,Textdraw1);
  310. TextDrawShowForPlayer(playerid,Textdraw2);
  311. PlayerTextDrawShow(playerid, Textdraw3[playerid]);
  312. PlayerTextDrawShow(playerid, Textdraw4[playerid]);
  313. PlayerTextDrawShow(playerid, Textdraw5[playerid]);
  314. hspeedinfotimer[playerid] = SetTimerEx("hSpeedINFO",1000,1,"d",playerid);
  315. }
  316. if(oldstate == PLAYER_STATE_DRIVER)
  317. {
  318. TextDrawHideForPlayer(playerid,Textdraw0);
  319. TextDrawHideForPlayer(playerid,Textdraw1);
  320. TextDrawHideForPlayer(playerid,Textdraw2);
  321. PlayerTextDrawHide(playerid, Textdraw3[playerid]);
  322. PlayerTextDrawHide(playerid, Textdraw4[playerid]);
  323. PlayerTextDrawHide(playerid, Textdraw5[playerid]);
  324. KillTimer(hspeedinfotimer[playerid]);
  325. }
  326. }
  327. return 1;
  328. }
  329.  
  330.  
  331. forward hSpeedINFO(PlayerId);
  332. public hSpeedINFO(PlayerId)
  333. {
  334. new String[150];
  335. format(String,150,"~R~%s",VehicleNames[GetVehicleModel(GetPlayerVehicleID(PlayerId))-400]);
  336. PlayerTextDrawSetString(PlayerId, Textdraw3[PlayerId], String);
  337. new Float:X;
  338. new Float:Y;
  339. new Float:Z;
  340. GetVehicleVelocity(GetPlayerVehicleID(PlayerId),X,Y,Z);
  341. format(String,150,"SPEED ~R~%d KM/H",floatround(floatsqroot(X * X + Y * Y + Z * Z) * 200.0000));
  342. PlayerTextDrawSetString(PlayerId, Textdraw4[PlayerId], String);
  343. new Float:Health;
  344. GetVehicleHealth(GetPlayerVehicleID(PlayerId),Health);
  345. format(String,150,"Health ~R~%d.0",floatround(Health / 10));
  346. PlayerTextDrawSetString(PlayerId, Textdraw5[PlayerId], String);
  347. return 1;
  348. }
Advertisement
Add Comment
Please, Sign In to add comment