Advertisement
Guest User

SynoSpeedo.pwn

a guest
Mar 15th, 2013
925
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.51 KB | None | 0 0
  1. /******************************************
  2. * Speedo Filterscript v1.0 SynoSpeedo *
  3. * Filterscript Programmer: SynonymousZ *
  4. ******************************************/
  5.  
  6. #include <a_samp>
  7.  
  8. new Text:Tacho_Box0;
  9. new Text:Tacho_Box1;
  10. new Text:Tacho_KMH[MAX_PLAYERS];
  11. new Text:Tacho_Box2;
  12. new Text:Tacho_Zustand[MAX_PLAYERS];
  13. new Text:Tacho_Tank[MAX_PLAYERS];
  14. new Text:Tacho_Car[MAX_PLAYERS];
  15.  
  16. new VehicleName[][] = {
  17. "Landstalker",
  18. "Bravura",
  19. "Buffalo",
  20. "Linerunner",
  21. "Pereniel",
  22. "Sentinel",
  23. "Dumper",
  24. "Feuerwehrwagen",
  25. "Müllabfuhr",
  26. "Stretch",
  27. "Manana",
  28. "Infernus",
  29. "Voodoo",
  30. "Pony",
  31. "Mule",
  32. "Cheetah",
  33. "Ambulance",
  34. "Leviathan",
  35. "Moonbeam",
  36. "Esperanto",
  37. "Taxi Company",
  38. "Washington",
  39. "Bobcat",
  40. "Mr Whoopee",
  41. "BF Injection",
  42. "Hunter",
  43. "Premier",
  44. "Enforcer",
  45. "Securicar",
  46. "Banshee",
  47. "Predator",
  48. "Bus",
  49. "Panzer",
  50. "Barracks",
  51. "Hotknife",
  52. "Trailer",
  53. "Previon",
  54. "Coach",
  55. "Cabbie",
  56. "Stallion",
  57. "Rumpo",
  58. "RC Bandit",
  59. "Romero",
  60. "Packer",
  61. "Monster Truck",
  62. "Admiral",
  63. "Squalo",
  64. "Seasparrow",
  65. "Pizzaboy",
  66. "Tram",
  67. "Trailer",
  68. "Turismo",
  69. "Speeder",
  70. "Reefer",
  71. "Tropic",
  72. "Flatbed",
  73. "Yankee",
  74. "Caddy",
  75. "Solair",
  76. "Berkley's RC Van",
  77. "Skimmer",
  78. "PCJ-600",
  79. "Roller",
  80. "Freeway",
  81. "RC Baron",
  82. "RC Raider",
  83. "Glendale",
  84. "Oceanic",
  85. "Sanchez",
  86. "Sparrow",
  87. "Patriot",
  88. "Quad",
  89. "Coastguard",
  90. "Dinghy",
  91. "Hermes",
  92. "Sabre",
  93. "Rustler",
  94. "ZR-350",
  95. "Walton",
  96. "Regina",
  97. "Comet",
  98. "Fahrrad",
  99. "Burrito",
  100. "Camper",
  101. "Marquis",
  102. "Baggage",
  103. "Dozer",
  104. "Maverick",
  105. "News Chopper",
  106. "Rancher",
  107. "FBI Rancher",
  108. "Virgo",
  109. "Greenwood",
  110. "Jetmax",
  111. "Hotring",
  112. "Sandking",
  113. "Blista Compact",
  114. "Police Maverick",
  115. "Boxville",
  116. "Benson",
  117. "Mesa",
  118. "RC Goblin",
  119. "Hotring Racer",
  120. "Hotring Racer",
  121. "Bloodring Banger",
  122. "Rancher",
  123. "Super GT",
  124. "Elegant",
  125. "Journey",
  126. "Bike",
  127. "Mountain Bike",
  128. "Beagle",
  129. "Cropdust",
  130. "Stunt",
  131. "Tanker",
  132. "RoadTrain",
  133. "Nebula",
  134. "Majestic",
  135. "Buccaneer",
  136. "Shamal",
  137. "Hydra",
  138. "FCR-900",
  139. "NRG-500",
  140. "Polizei-Motorrad",
  141. "Cement Truck",
  142. "Tow Truck",
  143. "Fortune",
  144. "Cadrona",
  145. "FBI Truck",
  146. "Willard",
  147. "Forklift",
  148. "Traktor",
  149. "Combine",
  150. "Feltzer",
  151. "Remington",
  152. "Slamvan",
  153. "Blade",
  154. "Freight",
  155. "Streak",
  156. "Vortex",
  157. "Vincent",
  158. "Bullet",
  159. "Clover",
  160. "Sadler",
  161. "Firetruck",
  162. "Hustler",
  163. "Intruder",
  164. "Primo",
  165. "Cargobob",
  166. "Tampa",
  167. "Sunrise",
  168. "Merit",
  169. "Utility",
  170. "Nevada",
  171. "Yosemite",
  172. "Windsor",
  173. "Monster Truck",
  174. "Monster Truck",
  175. "Uranus",
  176. "Jester",
  177. "Sultan",
  178. "Stratum",
  179. "Elegy",
  180. "Raindance",
  181. "RC Tiger",
  182. "Flash",
  183. "Tahoma",
  184. "Savanna",
  185. "Bandito",
  186. "Freight",
  187. "Trailer",
  188. "Kart",
  189. "Mower",
  190. "Duneride",
  191. "Sweeper",
  192. "Broadway",
  193. "Tornado",
  194. "AT-400",
  195. "DFT-30",
  196. "Huntley",
  197. "Stafford",
  198. "BF-400",
  199. "Newsvan",
  200. "Tug",
  201. "Trailer",
  202. "Emperor",
  203. "Wayfarer",
  204. "Euros",
  205. "Hotdog",
  206. "Club",
  207. "Trailer",
  208. "Trailer",
  209. "Andromada",
  210. "Dodo",
  211. "RC Cam",
  212. "Launch",
  213. "Streifenwagen",
  214. "Streifenwagen",
  215. "Streifenwagen",
  216. "Polizei Ranger",
  217. "Picador",
  218. "Wasserwerfer",
  219. "Alpha",
  220. "Phoenix",
  221. "Glendale",
  222. "Sadler",
  223. "Luggage Trailer",
  224. "Luggage Trailer",
  225. "Stair Trailer",
  226. "Boxville",
  227. "Farm Plow",
  228. "Utility Trailer"
  229. };
  230.  
  231. forward SpeedoUpdate();
  232.  
  233. public OnFilterScriptInit()
  234. {
  235. printf("SpeedoFilterscript: 'SynoSpeedo' wurde erfolgreich geladen!");
  236. printf("Filterscript Version: 1.0");
  237. Tacho_Box0 = TextDrawCreate(319.000000, 343.000000, " ");
  238. TextDrawBackgroundColor(Tacho_Box0, 255);
  239. TextDrawFont(Tacho_Box0, 1);
  240. TextDrawLetterSize(Tacho_Box0, 0.500000, 1.000000);
  241. TextDrawColor(Tacho_Box0, -1);
  242. TextDrawSetOutline(Tacho_Box0, 0);
  243. TextDrawSetProportional(Tacho_Box0, 1);
  244. TextDrawSetShadow(Tacho_Box0, 1);
  245. TextDrawUseBox(Tacho_Box0, 1);
  246. TextDrawBoxColor(Tacho_Box0, 255);
  247. TextDrawTextSize(Tacho_Box0, 85.000000, 0.000000);
  248.  
  249. Tacho_Box1 = TextDrawCreate(319.000000, 345.000000, " ");
  250. TextDrawBackgroundColor(Tacho_Box1, 255);
  251. TextDrawFont(Tacho_Box1, 1);
  252. TextDrawLetterSize(Tacho_Box1, 0.500000, 1.400000);
  253. TextDrawColor(Tacho_Box1, -1);
  254. TextDrawSetOutline(Tacho_Box1, 0);
  255. TextDrawSetProportional(Tacho_Box1, 1);
  256. TextDrawSetShadow(Tacho_Box1, 1);
  257. TextDrawUseBox(Tacho_Box1, 1);
  258. TextDrawBoxColor(Tacho_Box1, 255);
  259. TextDrawTextSize(Tacho_Box1, 309.000000, 0.000000);
  260.  
  261. Tacho_Box2 = TextDrawCreate(319.000000, 421.000000, " ");
  262. TextDrawBackgroundColor(Tacho_Box2, 255);
  263. TextDrawFont(Tacho_Box2, 1);
  264. TextDrawLetterSize(Tacho_Box2, 0.500000, 1.000000);
  265. TextDrawColor(Tacho_Box2, -1);
  266. TextDrawSetOutline(Tacho_Box2, 0);
  267. TextDrawSetProportional(Tacho_Box2, 1);
  268. TextDrawSetShadow(Tacho_Box2, 1);
  269. TextDrawUseBox(Tacho_Box2, 1);
  270. TextDrawBoxColor(Tacho_Box2, 255);
  271. TextDrawTextSize(Tacho_Box2, 83.000000, 0.000000);
  272.  
  273. SetTimer("SpeedoUpdate", 1000, 1);
  274. for(new i = 0; i<MAX_PLAYERS; i++)
  275. {
  276. Tacho_KMH[i] = TextDrawCreate(136.000000, 351.000000, " ");
  277. TextDrawBackgroundColor(Tacho_KMH[i], 255);
  278. TextDrawFont(Tacho_KMH[i], 1);
  279. TextDrawLetterSize(Tacho_KMH[i], 0.500000, 1.000000);
  280. TextDrawColor(Tacho_KMH[i], -1);
  281. TextDrawSetOutline(Tacho_KMH[i], 0);
  282. TextDrawSetProportional(Tacho_KMH[i], 1);
  283. TextDrawSetShadow(Tacho_KMH[i], 1);
  284.  
  285. Tacho_Zustand[i] = TextDrawCreate(136.000000, 366.000000, " ");
  286. TextDrawBackgroundColor(Tacho_Zustand[i], 255);
  287. TextDrawFont(Tacho_Zustand[i], 1);
  288. TextDrawLetterSize(Tacho_Zustand[i], 0.500000, 1.000000);
  289. TextDrawColor(Tacho_Zustand[i], -1);
  290. TextDrawSetOutline(Tacho_Zustand[i], 0);
  291. TextDrawSetProportional(Tacho_Zustand[i], 1);
  292. TextDrawSetShadow(Tacho_Zustand[i], 1);
  293.  
  294. Tacho_Tank[i] = TextDrawCreate(138.000000, 381.000000, " ");
  295. TextDrawBackgroundColor(Tacho_Tank[i], 255);
  296. TextDrawFont(Tacho_Tank[i], 1);
  297. TextDrawLetterSize(Tacho_Tank[i], 0.500000, 1.000000);
  298. TextDrawColor(Tacho_Tank[i], -1);
  299. TextDrawSetOutline(Tacho_Tank[i], 0);
  300. TextDrawSetProportional(Tacho_Tank[i], 1);
  301. TextDrawSetShadow(Tacho_Tank[i], 1);
  302.  
  303. Tacho_Car[i] = TextDrawCreate(138.000000, 398.000000, "");
  304. TextDrawBackgroundColor(Tacho_Car[i], 255);
  305. TextDrawFont(Tacho_Car[i], 1);
  306. TextDrawLetterSize(Tacho_Car[i], 0.500000, 1.000000);
  307. TextDrawColor(Tacho_Car[i], -1);
  308. TextDrawSetOutline(Tacho_Car[i], 0);
  309. TextDrawSetProportional(Tacho_Car[i], 1);
  310. TextDrawSetShadow(Tacho_Car[i], 1);
  311. }
  312. return 1;
  313. }
  314.  
  315. public OnFilterScriptExit()
  316. {
  317. for(new i = 0; i<MAX_PLAYERS; i++)
  318. {
  319. TextDrawHideForAll(Tacho_Box0);
  320. TextDrawDestroy(Tacho_Box0);
  321. TextDrawHideForAll(Tacho_Box1);
  322. TextDrawDestroy(Tacho_Box1);
  323. TextDrawHideForAll(Tacho_KMH[i]);
  324. TextDrawDestroy(Tacho_KMH[i]);
  325. TextDrawHideForAll(Tacho_Box2);
  326. TextDrawDestroy(Tacho_Box2);
  327. TextDrawHideForAll(Tacho_Zustand[i]);
  328. TextDrawDestroy(Tacho_Zustand[i]);
  329. TextDrawHideForAll(Tacho_Tank[i]);
  330. TextDrawDestroy(Tacho_Tank[i]);
  331. TextDrawHideForAll(Tacho_Car[i]);
  332. TextDrawDestroy(Tacho_Car[i]);
  333. }
  334. return 1;
  335. }
  336.  
  337. public OnPlayerStateChange(playerid, newstate, oldstate)
  338. {
  339. if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
  340. {
  341. TextDrawShowForPlayer(playerid, Tacho_Box0);
  342. TextDrawShowForPlayer(playerid, Tacho_Box1);
  343. TextDrawShowForPlayer(playerid, Tacho_KMH[playerid]);
  344. TextDrawShowForPlayer(playerid, Tacho_Box2);
  345. TextDrawShowForPlayer(playerid, Tacho_Zustand[playerid]);
  346. TextDrawShowForPlayer(playerid, Tacho_Tank[playerid]);
  347. TextDrawShowForPlayer(playerid, Tacho_Car[playerid]);
  348. }
  349. if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
  350. {
  351. TextDrawHideForPlayer(playerid, Tacho_Box0);
  352. TextDrawHideForPlayer(playerid, Tacho_Box1);
  353. TextDrawHideForPlayer(playerid, Tacho_KMH[playerid]);
  354. TextDrawHideForPlayer(playerid, Tacho_Box2);
  355. TextDrawHideForPlayer(playerid, Tacho_Zustand[playerid]);
  356. TextDrawHideForPlayer(playerid, Tacho_Tank[playerid]);
  357. TextDrawHideForPlayer(playerid, Tacho_Car[playerid]);
  358. }
  359. return 1;
  360. }
  361.  
  362. public SpeedoUpdate()
  363. {
  364. for(new i = 0; i<MAX_PLAYERS; i++)
  365. {
  366. new Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,final_speed_int;
  367. new veh = GetPlayerVehicleID(i);
  368. GetVehicleVelocity(veh, speed_x, speed_y, speed_z);
  369. final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*120.0;
  370. final_speed_int = floatround(final_speed,floatround_round);
  371. new kmh_anzahl = final_speed_int;
  372. new kmh[10],zustand[30],tank[10],cars[50];
  373. format(kmh, 10,"KM/H: %d", kmh_anzahl);
  374. new Float:hp;
  375. GetVehicleHealth(GetPlayerVehicleID(i), hp);
  376. if(hp > 700){format(zustand, 30,"Zustand: ~g~%.0f", hp);}
  377. if(hp < 700){format(zustand, 30,"Zustand: ~y~%.0f", hp);}
  378. if(hp < 350){format(zustand, 30,"Zustand: ~r~%.0f", hp);}
  379. if(hp < 250){format(zustand, 30,"Zustand: ~r~%s", "BOOM");}
  380. format(tank, 10,"Tank: %d", 100);//Euer Tanksystem einfügen
  381. format(cars, 50,"Auto: %s", VehicleName[GetVehicleModel(GetPlayerVehicleID(i))-400]);
  382. TextDrawSetString(Tacho_KMH[i], kmh);
  383. TextDrawSetString(Tacho_Zustand[i], zustand);
  384. TextDrawSetString(Tacho_Tank[i], tank);
  385. TextDrawSetString(Tacho_Car[i], cars);
  386.  
  387. }
  388. return 1;
  389. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement