Advertisement
Guest User

Spidometras

a guest
Dec 10th, 2013
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 12.51 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. //#define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6.  
  7. new PlayerText:Textdraw0[MAX_PLAYERS];
  8. new PlayerText:Textdraw1[MAX_PLAYERS];
  9. new PlayerText:Textdraw2[MAX_PLAYERS];
  10. new PlayerText:Textdraw3[MAX_PLAYERS];
  11. new PlayerText:Textdraw4[MAX_PLAYERS];
  12. new PlayerText:Textdraw5[MAX_PLAYERS];
  13. //new PlayerText:Textdraw6[MAX_PLAYERS];
  14.  
  15. #if defined FILTERSCRIPT
  16.  
  17. public OnFilterScriptInit()
  18. {
  19.     print("\n--------------------------------------");
  20.     print(" Blank Filterscript by your name here");
  21.     print("--------------------------------------\n");
  22.     return 1;
  23. }
  24.  
  25. public OnFilterScriptExit()
  26. {
  27.     return 1;
  28. }
  29.  
  30. #else
  31.  
  32. main()
  33. {
  34.     print("\n----------------------------------");
  35.     print(" Spidometras By: *Jamaika");
  36.     print(" Kreditus keisti draudziama!");
  37.     print("----------------------------------\n");
  38. }
  39.  
  40. #endif
  41.  
  42. public OnGameModeInit()
  43. {
  44.     // Don't use these lines if it's a filterscript
  45.     SetGameModeText("Blank Script");
  46.     AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  47.     return 1;
  48. }
  49.  
  50. public OnGameModeExit()
  51. {
  52.     return 1;
  53. }
  54.  
  55. public OnPlayerRequestClass(playerid, classid)
  56. {
  57.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  58.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  59.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  60.     return 1;
  61. }
  62.  
  63. public OnPlayerConnect(playerid)
  64. {
  65. Textdraw0[playerid] = CreatePlayerTextDraw(playerid, 630.750000, 362.000030, "usebox");
  66. PlayerTextDrawLetterSize(playerid, Textdraw0[playerid], 0.000000, 7.849999);
  67. PlayerTextDrawTextSize(playerid, Textdraw0[playerid], 437.375000, 0.000000);
  68. PlayerTextDrawAlignment(playerid, Textdraw0[playerid], 1);
  69. PlayerTextDrawColor(playerid, Textdraw0[playerid], 0);
  70. PlayerTextDrawUseBox(playerid, Textdraw0[playerid], true);
  71. PlayerTextDrawBoxColor(playerid, Textdraw0[playerid], 102);
  72. PlayerTextDrawSetShadow(playerid, Textdraw0[playerid], 0);
  73. PlayerTextDrawSetOutline(playerid, Textdraw0[playerid], 0);
  74. PlayerTextDrawFont(playerid, Textdraw0[playerid], 0);
  75.  
  76. Textdraw1[playerid] = CreatePlayerTextDraw(playerid, 463.125000, 350.583343, "Spidometras");
  77. PlayerTextDrawLetterSize(playerid, Textdraw1[playerid], 0.618749, 1.220833);
  78. PlayerTextDrawAlignment(playerid, Textdraw1[playerid], 1);
  79. PlayerTextDrawColor(playerid, Textdraw1[playerid], -1);
  80. PlayerTextDrawSetShadow(playerid, Textdraw1[playerid], 0);
  81. PlayerTextDrawSetOutline(playerid, Textdraw1[playerid], 1);
  82. PlayerTextDrawBackgroundColor(playerid, Textdraw1[playerid], 51);
  83. PlayerTextDrawFont(playerid, Textdraw1[playerid], 3);
  84. PlayerTextDrawSetProportional(playerid, Textdraw1[playerid], 1);
  85.  
  86. Textdraw2[playerid] = CreatePlayerTextDraw(playerid, 444.375000, 366.333374, "Greitis");
  87. PlayerTextDrawLetterSize(playerid, Textdraw2[playerid], 0.449999, 1.600000);
  88. PlayerTextDrawAlignment(playerid, Textdraw2[playerid], 1);
  89. PlayerTextDrawColor(playerid, Textdraw2[playerid], -1);
  90. PlayerTextDrawSetShadow(playerid, Textdraw2[playerid], 0);
  91. PlayerTextDrawSetOutline(playerid, Textdraw2[playerid], 1);
  92. PlayerTextDrawBackgroundColor(playerid, Textdraw2[playerid], 51);
  93. PlayerTextDrawFont(playerid, Textdraw2[playerid], 1);
  94. PlayerTextDrawSetProportional(playerid, Textdraw2[playerid], 1);
  95.  
  96. Textdraw3[playerid] = CreatePlayerTextDraw(playerid, 448.750000, 378.000122, "0");
  97. PlayerTextDrawLetterSize(playerid, Textdraw3[playerid], 0.878125, 2.825000);
  98. PlayerTextDrawAlignment(playerid, Textdraw3[playerid], 1);
  99. PlayerTextDrawColor(playerid, Textdraw3[playerid], 8388863);
  100. PlayerTextDrawSetShadow(playerid, Textdraw3[playerid], 0);
  101. PlayerTextDrawSetOutline(playerid, Textdraw3[playerid], 1);
  102. PlayerTextDrawBackgroundColor(playerid, Textdraw3[playerid], 51);
  103. PlayerTextDrawFont(playerid, Textdraw3[playerid], 3);
  104. PlayerTextDrawSetProportional(playerid, Textdraw3[playerid], 1);
  105.  
  106. Textdraw4[playerid] = CreatePlayerTextDraw(playerid, 521.875000, 377.416778, "Masina: Infernus");
  107. PlayerTextDrawLetterSize(playerid, Textdraw4[playerid], 0.268124, 1.378332);
  108. PlayerTextDrawAlignment(playerid, Textdraw4[playerid], 1);
  109. PlayerTextDrawColor(playerid, Textdraw4[playerid], -1);
  110. PlayerTextDrawSetShadow(playerid, Textdraw4[playerid], 0);
  111. PlayerTextDrawSetOutline(playerid, Textdraw4[playerid], 1);
  112. PlayerTextDrawBackgroundColor(playerid, Textdraw4[playerid], 51);
  113. PlayerTextDrawFont(playerid, Textdraw4[playerid], 1);
  114. PlayerTextDrawSetProportional(playerid, Textdraw4[playerid], 1);
  115.  
  116. Textdraw5[playerid] = CreatePlayerTextDraw(playerid, 521.250000, 389.083374, "Bukle: 100");
  117. PlayerTextDrawLetterSize(playerid, Textdraw5[playerid], 0.348125, 1.168333);
  118. PlayerTextDrawAlignment(playerid, Textdraw5[playerid], 1);
  119. PlayerTextDrawColor(playerid, Textdraw5[playerid], -1);
  120. PlayerTextDrawSetShadow(playerid, Textdraw5[playerid], 0);
  121. PlayerTextDrawSetOutline(playerid, Textdraw5[playerid], 1);
  122. PlayerTextDrawBackgroundColor(playerid, Textdraw5[playerid], 51);
  123. PlayerTextDrawFont(playerid, Textdraw5[playerid], 1);
  124. PlayerTextDrawSetProportional(playerid, Textdraw5[playerid], 1);
  125.  
  126. /*Textdraw6[playerid] = CreatePlayerTextDraw(playerid, 527.500000, 398.416625, "Kuras: 100l");
  127. PlayerTextDrawLetterSize(playerid, Textdraw6[playerid], 0.274999, 1.319999);
  128. PlayerTextDrawAlignment(playerid, Textdraw6[playerid], 1);
  129. PlayerTextDrawColor(playerid, Textdraw6[playerid], -1);
  130. PlayerTextDrawSetShadow(playerid, Textdraw6[playerid], 0);
  131. PlayerTextDrawSetOutline(playerid, Textdraw6[playerid], 1);
  132. PlayerTextDrawBackgroundColor(playerid, Textdraw6[playerid], 51);
  133. PlayerTextDrawFont(playerid, Textdraw6[playerid], 1);
  134. PlayerTextDrawSetProportional(playerid, Textdraw6[playerid], 1);*/
  135.  
  136. return 1;
  137. }
  138.  
  139. public OnPlayerDisconnect(playerid, reason)
  140. {
  141.     return 1;
  142. }
  143.  
  144. public OnPlayerSpawn(playerid)
  145. {
  146.     return 1;
  147. }
  148.  
  149. public OnPlayerDeath(playerid, killerid, reason)
  150. {
  151.     return 1;
  152. }
  153.  
  154. public OnVehicleSpawn(vehicleid)
  155. {
  156.     return 1;
  157. }
  158.  
  159. public OnVehicleDeath(vehicleid, killerid)
  160. {
  161.     return 1;
  162. }
  163.  
  164. public OnPlayerText(playerid, text[])
  165. {
  166.     return 1;
  167. }
  168.  
  169. public OnPlayerCommandText(playerid, cmdtext[])
  170. {
  171.     if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  172.     {
  173.         // Do something here
  174.         return 1;
  175.     }
  176.     return 0;
  177. }
  178.  
  179. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  180. {
  181.     return 1;
  182. }
  183.  
  184. public OnPlayerExitVehicle(playerid, vehicleid)
  185. {
  186.     return 1;
  187. }
  188.  
  189. public OnPlayerStateChange(playerid, newstate, oldstate)
  190. {
  191. if(newstate == PLAYER_STATE_DRIVER)
  192. {
  193.     PlayAudioStreamForPlayer(playerid, "http://www.radijas.fm/media/_catalog/www.radijas.fm-radijo-stotis-hot-fm.pls");
  194.     PlayerTextDrawShow(playerid, PlayerText:Textdraw0[playerid]);
  195.     PlayerTextDrawShow(playerid, PlayerText:Textdraw1[playerid]);
  196.     PlayerTextDrawShow(playerid, PlayerText:Textdraw2[playerid]);
  197.     PlayerTextDrawShow(playerid, PlayerText:Textdraw3[playerid]);
  198.     PlayerTextDrawShow(playerid, PlayerText:Textdraw4[playerid]);
  199.     PlayerTextDrawShow(playerid, PlayerText:Textdraw5[playerid]);
  200.     //PlayerTextDrawShow(playerid, PlayerText:Textdraw6[playerid]);
  201. }
  202. else if(oldstate == PLAYER_STATE_DRIVER)
  203. {
  204.     StopAudioStreamForPlayer(playerid);
  205.     PlayerTextDrawHide(playerid, PlayerText:Textdraw0[playerid]);
  206.     PlayerTextDrawHide(playerid, PlayerText:Textdraw1[playerid]);
  207.     PlayerTextDrawHide(playerid, PlayerText:Textdraw2[playerid]);
  208.     PlayerTextDrawHide(playerid, PlayerText:Textdraw3[playerid]);
  209.     PlayerTextDrawHide(playerid, PlayerText:Textdraw4[playerid]);
  210.     PlayerTextDrawHide(playerid, PlayerText:Textdraw5[playerid]);
  211.     //PlayerTextDrawHide(playerid, PlayerText:Textdraw6[playerid]);
  212. }
  213.  
  214. return 1;
  215. }
  216.  
  217. public OnPlayerEnterCheckpoint(playerid)
  218. {
  219.     return 1;
  220. }
  221.  
  222. public OnPlayerLeaveCheckpoint(playerid)
  223. {
  224.     return 1;
  225. }
  226.  
  227. public OnPlayerEnterRaceCheckpoint(playerid)
  228. {
  229.     return 1;
  230. }
  231.  
  232. public OnPlayerLeaveRaceCheckpoint(playerid)
  233. {
  234.     return 1;
  235. }
  236.  
  237. public OnRconCommand(cmd[])
  238. {
  239.     return 1;
  240. }
  241.  
  242. public OnPlayerRequestSpawn(playerid)
  243. {
  244.     return 1;
  245. }
  246.  
  247. public OnObjectMoved(objectid)
  248. {
  249.     return 1;
  250. }
  251.  
  252. public OnPlayerObjectMoved(playerid, objectid)
  253. {
  254.     return 1;
  255. }
  256.  
  257. public OnPlayerPickUpPickup(playerid, pickupid)
  258. {
  259.     return 1;
  260. }
  261.  
  262. public OnVehicleMod(playerid, vehicleid, componentid)
  263. {
  264.     return 1;
  265. }
  266.  
  267. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  268. {
  269.     return 1;
  270. }
  271.  
  272. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  273. {
  274.     return 1;
  275. }
  276.  
  277. public OnPlayerSelectedMenuRow(playerid, row)
  278. {
  279.     return 1;
  280. }
  281.  
  282. public OnPlayerExitedMenu(playerid)
  283. {
  284.     return 1;
  285. }
  286.  
  287. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  288. {
  289.     return 1;
  290. }
  291.  
  292. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  293. {
  294.     return 1;
  295. }
  296.  
  297. public OnRconLoginAttempt(ip[], password[], success)
  298. {
  299.     return 1;
  300. }
  301.  
  302. public OnPlayerUpdate(playerid)
  303. {
  304. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  305. {
  306.     new string[300];
  307.     new VehicleNames[212][] = {
  308.     "Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus",
  309.     "Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi","Washington","Bobcat","Mr Whoopee","BF Injection",
  310.     "Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie",
  311.     "Stallion","Rumpo","RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder",
  312.     "Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider",
  313.     "Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR3 50","Walton","Regina",
  314.     "Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo","Greenwood",
  315.     "Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson","Mesa","RC Goblin","Hotring Racer A","Hotring Racer B",
  316.     "Bloodring Banger","Rancher","Super GT","Elegant","Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain",
  317.     "Nebula","Majestic","Buccaneer","Shamal","Hydra","FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck",
  318.     "Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent","Bullet","Clover",
  319.     "Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A",
  320.     "Monster B","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight","Trailer",
  321.     "Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400","Newsvan","Tug","Trailer A","Emperor",
  322.     "Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C","Andromada","Dodo","RC Cam","Launch","Police Car (LSPD)","Police Car (SFPD)",
  323.     "Police Car (LVPD)","Police Ranger","Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A","Luggage Trailer B",
  324.     "Stair Trailer","Boxville","Farm Plow","Utility Trailer" };
  325.     format(string,sizeof(string),"%i",MasinosGreitis(playerid));
  326.     PlayerTextDrawSetString(playerid, Textdraw3[playerid], string);
  327.  
  328.     new vehicleid = GetPlayerVehicleID(playerid);
  329.     new model = GetVehicleModel(vehicleid);
  330.     format(string, sizeof(string), "Masina: %s", VehicleNames[model-400]);
  331.     PlayerTextDrawSetString(playerid, Textdraw4[playerid], string);
  332.     //format(string, sizeof(string), "Kuras: %il", vehicleDB[vehicleid][gas]);
  333.     //PlayerTextDrawSetString(playerid, Textdraw6[playerid], string);
  334.  
  335.     new Float:vehHealth;
  336.     GetVehicleHealth(vehicleid, vehHealth);
  337.     new vHealth = floatround((vehHealth - 250.0) / 7.5);
  338.     format(string, sizeof(string), "Bukle: %i%%", vHealth);
  339.     PlayerTextDrawSetString(playerid, Textdraw5[playerid], string);
  340. }
  341.  
  342. return 1;
  343. }
  344.  
  345. public OnPlayerStreamIn(playerid, forplayerid)
  346. {
  347.     return 1;
  348. }
  349.  
  350. public OnPlayerStreamOut(playerid, forplayerid)
  351. {
  352.     return 1;
  353. }
  354.  
  355. public OnVehicleStreamIn(vehicleid, forplayerid)
  356. {
  357.     return 1;
  358. }
  359.  
  360. public OnVehicleStreamOut(vehicleid, forplayerid)
  361. {
  362.     return 1;
  363. }
  364.  
  365. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  366. {
  367.     return 1;
  368. }
  369.  
  370. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  371. {
  372.     return 1;
  373. }
  374. stock MasinosGreitis(playerid)
  375. {
  376. new Float:Vx,Float:Vy,Float:Vz,Float:rtn;
  377. GetVehicleVelocity(GetPlayerVehicleID(playerid),Vx,Vy,Vz);
  378. rtn = floatsqroot(Vx*Vx + Vy*Vy + Vz*Vz);
  379. return floatround(rtn * 100 * 1.61);
  380. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement