BlueXSpeed
Autor: [PP]KIZANO | Publicado: 2011-09-29T07:42:00-07:00

Olá pessoal hoje venho postar um velocimentro feito por mim, ainda é uma versão beta, fiz em mt pouco tempo xD, mas espero que gostem.

Screens



Creditos

Zamaroht - Zamaroht TextDraw Editor V1.6

SlashPT - Pela stock (GetSpeed)
BlueX - Pelo Velocimetro

Source


/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;XX
XX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;[BXS] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;XX
XX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[Creditos: BlueX] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; XX
XX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;XX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
#include &lt;a_samp&gt;

new Text:Textdraw0;
new Text:Textdraw1;
new Text:Textdraw2;
new Text:Textdraw3;
new Text:Textdraw4;
new Text:Textdraw5;

static Float:poskm [3];

new veiculos[][] ={
"Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster",
"Stretch","Manana","Infernus","Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto",
"Taxi","Washington","Bobcat","Mr Whoopee","BF Injection","Hunter","Premier","Enforcer","Securicar","Banshee",
"Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie","Stallion","Rumpo",
"RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer",
"Turismo","Speeder","Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer",
"PCJ-600","Faggio","Freeway","RC Baron","RC Raider","Glendale","Oceanic","Sanchez","Sparrow","Patriot",
"Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR3 50","Walton","Regina","Comet","BMX",
"Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo",
"Greenwood","Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson","Mesa",
"RC Goblin","Hotring Racer A","Hotring Racer B","Bloodring Banger","Rancher","Super GT","Elegant",
"Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain","Nebula","Majestic",
"Buccaneer","Shamal","Hydra","FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona",
"FBI Truck","Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight",
"Streak","Vortex","Vincent","Bullet","Clover","Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob",
"Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A","Monster B","Uranus",
"Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight",
"Trailer","Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford",
"BF-400","Newsvan","Tug","Trailer A","Emperor","Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C",
"Andromada","Dodo","RC Cam","Launch","Police Car (LSPD)","Police Car (SFPD)","Police Car (LVPD)","Police Ranger",
"Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A","Luggage Trailer B",
"Stair Trailer","Boxville","Farm Plow","Utility Trailer" };

public OnFilterScriptInit()
{
&nbsp; &nbsp; print("Velocimetro by: BlueX");

&nbsp; &nbsp; // Create the textdraws:
&nbsp; &nbsp; Textdraw0 = TextDrawCreate(517.000000, 324.000000, "Velocidade: Km/h");
&nbsp; &nbsp; TextDrawBackgroundColor(Textdraw0, -16776961);
&nbsp; &nbsp; TextDrawFont(Textdraw0, 2);
&nbsp; &nbsp; TextDrawLetterSize(Textdraw0, 0.280000, 1.000000);
&nbsp; &nbsp; TextDrawColor(Textdraw0, -1);
&nbsp; &nbsp; TextDrawSetOutline(Textdraw0, 0);
&nbsp; &nbsp; TextDrawSetProportional(Textdraw0, 1);
&nbsp; &nbsp; TextDrawSetShadow(Textdraw0, 1);

&nbsp; &nbsp; Textdraw1 = TextDrawCreate(640.000000, 329.000000, "_");
&nbsp; &nbsp; TextDrawBackgroundColor(Textdraw1, 255);
&nbsp; &nbsp; TextDrawFont(Textdraw1, 3);
&nbsp; &nbsp; TextDrawLetterSize(Textdraw1, 0.280000, 1.000000);
&nbsp; &nbsp; TextDrawColor(Textdraw1, 16777215);
&nbsp; &nbsp; TextDrawSetOutline(Textdraw1, 1);
&nbsp; &nbsp; TextDrawSetProportional(Textdraw1, 1);
&nbsp; &nbsp; TextDrawUseBox(Textdraw1, 1);
&nbsp; &nbsp; TextDrawBoxColor(Textdraw1, 106);
&nbsp; &nbsp; TextDrawTextSize(Textdraw1, 499.000000, 3.000000);

&nbsp; &nbsp; Textdraw2 = TextDrawCreate(640.000000, 315.000000, "_");
&nbsp; &nbsp; TextDrawBackgroundColor(Textdraw2, 255);
&nbsp; &nbsp; TextDrawFont(Textdraw2, 3);
&nbsp; &nbsp; TextDrawLetterSize(Textdraw2, 0.280000, 1.000000);
&nbsp; &nbsp; TextDrawColor(Textdraw2, 16777215);
&nbsp; &nbsp; TextDrawSetOutline(Textdraw2, 1);
&nbsp; &nbsp; TextDrawSetProportional(Textdraw2, 1);
&nbsp; &nbsp; TextDrawUseBox(Textdraw2, 1);
&nbsp; &nbsp; TextDrawBoxColor(Textdraw2, 106);
&nbsp; &nbsp; TextDrawTextSize(Textdraw2, 499.000000, 3.000000);

&nbsp; &nbsp; Textdraw3 = TextDrawCreate(640.000000, 343.000000, "_");
&nbsp; &nbsp; TextDrawBackgroundColor(Textdraw3, 255);
&nbsp; &nbsp; TextDrawFont(Textdraw3, 3);
&nbsp; &nbsp; TextDrawLetterSize(Textdraw3, 0.280000, 1.000000);
&nbsp; &nbsp; TextDrawColor(Textdraw3, 16777215);
&nbsp; &nbsp; TextDrawSetOutline(Textdraw3, 1);
&nbsp; &nbsp; TextDrawSetProportional(Textdraw3, 1);
&nbsp; &nbsp; TextDrawUseBox(Textdraw3, 1);
&nbsp; &nbsp; TextDrawBoxColor(Textdraw3, 106);
&nbsp; &nbsp; TextDrawTextSize(Textdraw3, 499.000000, 3.000000);

&nbsp; &nbsp; Textdraw4 = TextDrawCreate(517.000000, 337.000000, "Veiculo:");
&nbsp; &nbsp; TextDrawBackgroundColor(Textdraw4, -16776961);
&nbsp; &nbsp; TextDrawFont(Textdraw4, 2);
&nbsp; &nbsp; TextDrawLetterSize(Textdraw4, 0.280000, 1.000000);
&nbsp; &nbsp; TextDrawColor(Textdraw4, -1);
&nbsp; &nbsp; TextDrawSetOutline(Textdraw4, 0);
&nbsp; &nbsp; TextDrawSetProportional(Textdraw4, 1);
&nbsp; &nbsp; TextDrawSetShadow(Textdraw4, 1);

&nbsp; &nbsp; Textdraw5 = TextDrawCreate(640.000000, 349.000000, "_");
&nbsp; &nbsp; TextDrawBackgroundColor(Textdraw5, 255);
&nbsp; &nbsp; TextDrawFont(Textdraw5, 3);
&nbsp; &nbsp; TextDrawLetterSize(Textdraw5, 0.280000, 1.000000);
&nbsp; &nbsp; TextDrawColor(Textdraw5, 16777215);
&nbsp; &nbsp; TextDrawSetOutline(Textdraw5, 1);
&nbsp; &nbsp; TextDrawSetProportional(Textdraw5, 1);
&nbsp; &nbsp; TextDrawUseBox(Textdraw5, 1);
&nbsp; &nbsp; TextDrawBoxColor(Textdraw5, 106);
&nbsp; &nbsp; TextDrawTextSize(Textdraw5, 499.000000, 3.000000);

&nbsp; &nbsp; return 1;
}

public OnFilterScriptExit()
{
&nbsp; &nbsp; TextDrawHideForAll(Textdraw0);
&nbsp; &nbsp; TextDrawDestroy(Textdraw0);
&nbsp; &nbsp; TextDrawHideForAll(Textdraw1);
&nbsp; &nbsp; TextDrawDestroy(Textdraw1);
&nbsp; &nbsp; TextDrawHideForAll(Textdraw2);
&nbsp; &nbsp; TextDrawDestroy(Textdraw2);
&nbsp; &nbsp; TextDrawHideForAll(Textdraw3);
&nbsp; &nbsp; TextDrawDestroy(Textdraw3);
&nbsp; &nbsp; TextDrawHideForAll(Textdraw4);
&nbsp; &nbsp; TextDrawDestroy(Textdraw4);
&nbsp; &nbsp; TextDrawHideForAll(Textdraw5);
&nbsp; &nbsp; TextDrawDestroy(Textdraw5);
&nbsp; &nbsp; return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
&nbsp; &nbsp; if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
&nbsp; &nbsp; {
&nbsp; &nbsp; &nbsp; &nbsp; Speed(playerid);
&nbsp; &nbsp; }
&nbsp; &nbsp; else if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
&nbsp; &nbsp; {
&nbsp; &nbsp; &nbsp; &nbsp; TextDrawHideForPlayer(playerid, Textdraw0);
&nbsp; &nbsp; &nbsp; &nbsp; TextDrawHideForPlayer(playerid, Textdraw1);
&nbsp; &nbsp; &nbsp; &nbsp; TextDrawHideForPlayer(playerid, Textdraw2);
&nbsp; &nbsp; &nbsp; &nbsp; TextDrawHideForPlayer(playerid, Textdraw3);
&nbsp; &nbsp; &nbsp; &nbsp; TextDrawHideForPlayer(playerid, Textdraw4);
&nbsp; &nbsp; &nbsp; &nbsp; TextDrawHideForPlayer(playerid, Textdraw5);
&nbsp; &nbsp; }
&nbsp; &nbsp; return 1;
}
Speed(playerid);
public Speed(playerid)
{
&nbsp; &nbsp; new MySpeed[48];
&nbsp; &nbsp; new MyCar[48];
&nbsp; &nbsp; format(MySpeed,sizeof(MySpeed),"Velocidade: %d Km/h",GetSpeed(playerid));
&nbsp; &nbsp; format(MyCar,sizeof(MyCar),"Veiculo: %s",veiculos[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
&nbsp; &nbsp; TextDrawSetString(Textdraw0, MySpeed);
&nbsp; &nbsp; TextDrawSetString(Textdraw4, MyCar);
&nbsp; &nbsp; TextDrawShowForPlayer(playerid, Textdraw0);
&nbsp; &nbsp; TextDrawShowForPlayer(playerid, Textdraw1);
&nbsp; &nbsp; TextDrawShowForPlayer(playerid, Textdraw2);
&nbsp; &nbsp; TextDrawShowForPlayer(playerid, Textdraw3);
&nbsp; &nbsp; TextDrawShowForPlayer(playerid, Textdraw4);
&nbsp; &nbsp; TextDrawShowForPlayer(playerid, Textdraw5);
&nbsp; &nbsp; SetTimerEx("Speed",1,0,"i",playerid);
}
stock
&nbsp; &nbsp; GetSpeed ( playerid , mode = 1 )
{
&nbsp; &nbsp; GetVehicleVelocity ( GetPlayerVehicleID ( playerid ) , poskm [ 0 ] , poskm [ 1 ] , poskm [ 2 ] ) ;
&nbsp; &nbsp; return IsPlayerInAnyVehicle ( playerid ) ? floatround ( ( ( floatsqroot ( ( ( poskm [ 0 ] * poskm [ 0 ] ) + ( poskm [ 1 ] * poskm [ 1 ] ) + ( poskm [ 2 ] * poskm [ 2 ] ) ) ) * ( !mode ? 105.0 : 170.0 ) ) ) * 1 ) : 0;
}Download Pastebin
pastebin