Advertisement
Guest User

Velocímetro básico

a guest
Oct 1st, 2020
2,199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.52 KB | None | 0 0
  1. #include <a_samp>
  2. #include zcmd
  3. new Text:Velocidadex[MAX_PLAYERS],
  4. Text:Veiculox[MAX_PLAYERS],
  5. Text:Lataria[MAX_PLAYERS],
  6. Float:Latariax;
  7.  
  8.  
  9. new Veiculos[][] =
  10. {
  11. "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel",
  12. "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus",
  13. "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam",
  14. "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection",
  15. "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus",
  16. "Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie",
  17. "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral",
  18. "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder",
  19. "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair", "Berkley's RC Van",
  20. "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale",
  21. "Oceanic","Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy",
  22. "Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX",
  23. "Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper",
  24. "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking",
  25. "Blista Compact", "Police Maverick", "Boxvillde", "Benson", "Mesa", "RC Goblin",
  26. "Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT",
  27. "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "Stunt",
  28. "Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra",
  29. "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune",
  30. "Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer",
  31. "Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent",
  32. "Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder", "Primo",
  33. "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite",
  34. "Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratium",
  35. "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito",
  36. "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper",
  37. "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400",
  38. "News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
  39. "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car",
  40. "Police Car", "Police Car", "Police Ranger", "Picador", "S.W.A.T", "Alpha",
  41. "Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville",
  42. "Tiller", "Utility Trailer"
  43. };
  44.  
  45. public OnPlayerConnect(playerid)
  46. {
  47. SendClientMessage(playerid, -1,"by: SkolPlay");
  48. SendClientMessage(playerid, -1,"Não retire os creditos!");
  49. return 1;
  50. }
  51.  
  52. public OnGameModeInit()
  53. {
  54. for(new I = 0; I < MAX_PLAYERS; I ++)
  55. {
  56.  
  57. Velocidadex[I] = TextDrawCreate(145.000000, 378.000000, " ");
  58. TextDrawBackgroundColor(Velocidadex[I], 255);
  59. TextDrawFont(Velocidadex[I], 1);
  60. TextDrawLetterSize(Velocidadex[I], 0.330000, 1.000000);
  61. TextDrawColor(Velocidadex[I], -1);
  62. TextDrawSetOutline(Velocidadex[I], 0);
  63. TextDrawSetProportional(Velocidadex[I], 1);
  64. TextDrawSetShadow(Velocidadex[I], 1);
  65. TextDrawSetSelectable(Velocidadex[I], 0);
  66.  
  67. Veiculox[I] = TextDrawCreate(145.000000, 393.000000, " ");
  68. TextDrawBackgroundColor(Veiculox[I], 255);
  69. TextDrawFont(Veiculox[I], 1);
  70. TextDrawLetterSize(Veiculox[I], 0.330000, 1.000000);
  71. TextDrawColor(Veiculox[I], -1);
  72. TextDrawSetOutline(Veiculox[I], 0);
  73. TextDrawSetProportional(Veiculox[I], 1);
  74. TextDrawSetShadow(Veiculox[I], 1);
  75. TextDrawSetSelectable(Veiculox[I], 0);
  76.  
  77. Lataria[I] = TextDrawCreate(145.000000, 405.000000, " ");
  78. TextDrawBackgroundColor(Lataria[I], 255);
  79. TextDrawFont(Lataria[I], 1);
  80. TextDrawLetterSize(Lataria[I], 0.330000, 1.000000);
  81. TextDrawColor(Lataria[I], -1);
  82. TextDrawSetOutline(Lataria[I], 0);
  83. TextDrawSetProportional(Lataria[I], 1);
  84. TextDrawSetShadow(Lataria[I], 1);
  85. TextDrawSetSelectable(Lataria[I], 0);
  86. }
  87. SetTimer("Velocimetro", 1, 1);
  88. return 1;
  89. }
  90.  
  91. forward Velocimetro(playerid);
  92. public Velocimetro(playerid)
  93. {
  94. if(GetPlayerState(playerid) == 2)
  95. {
  96.  
  97. new vehicle, velocidade, Float:Pos[3], string[180];
  98. vehicle = GetPlayerVehicleID(playerid);
  99. GetVehicleVelocity(vehicle, Pos[0], Pos[1], Pos[2]);
  100. velocidade = floatround(floatsqroot(Pos[0] * Pos[0] + Pos[1] * Pos[1] + Pos[2] * Pos[2]) * 180.00);
  101. format(string,sizeof(string), "~b~~>~~b~~h~~h~Velocidade:~w~%3d km/h", velocidade);
  102. TextDrawSetString(Velocidadex[playerid], string);
  103. TextDrawShowForPlayer(playerid, Velocidadex[playerid]);
  104. //==========================================================================================================================
  105. format(string,sizeof(string), "~b~~>~~b~~h~~h~Veiculo: ~w~%s", Veiculos[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
  106. TextDrawShowForPlayer(playerid,Veiculox[playerid]);
  107. TextDrawSetString(Veiculox[playerid], string);
  108. //==========================================================================================================================
  109. GetVehicleHealth(GetPlayerVehicleID(playerid), Latariax);
  110. format(string,sizeof(string), "~b~~>~~b~~h~~h~Lataria:~w~%0.0f%", Latariax/10);
  111. TextDrawShowForPlayer(playerid,Lataria[playerid]);
  112. TextDrawSetString(Lataria[playerid], string);
  113. }
  114. else
  115. {
  116.  
  117. TextDrawHideForPlayer(playerid, Velocidadex[playerid]);
  118. TextDrawHideForPlayer(playerid, Veiculox[playerid]);
  119. TextDrawHideForPlayer(playerid, Lataria[playerid]);
  120. }
  121. return 1;
  122. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement