Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Créditos:Feito por Bruno Alves
- #include <a_samp>
- new Text:Textdraw0;
- new Text:Textdraw1;
- new Text:Textdraw2;
- new Float:Velocidade [3];
- new Vehicles[][] ={
- "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()
- {
- Textdraw0 = TextDrawCreate(39.000000, 134.000000, "--");//text draw do veiculo
- TextDrawBackgroundColor(Textdraw0, 255);
- TextDrawFont(Textdraw0, 3);
- TextDrawLetterSize(Textdraw0, 0.500000, 1.000000);
- TextDrawColor(Textdraw0, 16711935);
- TextDrawSetOutline(Textdraw0, 1);
- TextDrawSetProportional(Textdraw0, 1);
- TextDrawTextSize(Textdraw0, 187.000000, 549.000000);
- Textdraw1 = TextDrawCreate(39.000000, 149.000000, "--");//velocidade
- TextDrawBackgroundColor(Textdraw1, 255);
- TextDrawFont(Textdraw1, 3);
- TextDrawLetterSize(Textdraw1, 0.500000, 1.000000);
- TextDrawColor(Textdraw1, 16711935);
- TextDrawSetOutline(Textdraw1, 1);
- TextDrawSetProportional(Textdraw1, 1);
- TextDrawTextSize(Textdraw1, 187.000000, 272.000000);
- SetTimer("Speed", 1000, true);
- Textdraw2 = TextDrawCreate(39.000000, 164.000000, "--");//Hp (vida)
- TextDrawBackgroundColor(Textdraw2, 255);
- TextDrawFont(Textdraw2, 3);
- TextDrawLetterSize(Textdraw2, 0.500000, 1.000000);
- TextDrawColor(Textdraw2, 16711935);
- TextDrawSetOutline(Textdraw2, 1);
- TextDrawSetProportional(Textdraw2, 1);
- TextDrawTextSize(Textdraw2, 187.000000, 272.000000);
- return 1;
- }
- public OnFilterScriptExit()
- {
- TextDrawHideForAll(Textdraw2);
- TextDrawDestroy(Textdraw2);
- TextDrawHideForAll(Textdraw0);
- TextDrawDestroy(Textdraw0);
- TextDrawHideForAll(Textdraw1);
- TextDrawDestroy(Textdraw1);
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
- {
- Speed(playerid);
- }
- else if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
- {
- TextDrawHideForPlayer(playerid, Textdraw0);
- TextDrawHideForPlayer(playerid, Textdraw1);
- TextDrawHideForPlayer(playerid, Textdraw2);
- }
- return 1;
- }
- forward Speed(playerid);
- public Speed(playerid)
- {
- new MySpeed[48];
- new MyCar[48];
- new MySaude[48];
- new Float:Speedo_HP;
- new vehicle = GetPlayerVehicleID(playerid);
- GetVehicleHealth(vehicle, Speedo_HP);
- format(MySpeed,sizeof(MySpeed),"~p~Speed:~y~%d Km/h",GetSpeed(playerid));
- format(MyCar,sizeof(MyCar),"~r~Veiculo:~b~%s",Vehicles[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
- format(MySaude,sizeof(MySaude),"~p~Saude:~y~%0.0f%%",Speedo_HP/10);
- TextDrawSetString(Textdraw2, MySaude);
- TextDrawSetString(Textdraw1, MySpeed);
- TextDrawSetString(Textdraw0, MyCar);
- TextDrawShowForPlayer(playerid, Textdraw0);
- TextDrawShowForPlayer(playerid, Textdraw1);
- TextDrawShowForPlayer(playerid, Textdraw2);
- return 1;
- }
- stock
- GetSpeed ( playerid , mode = 1 )// stock by:SlashPT
- {
- GetVehicleVelocity ( GetPlayerVehicleID ( playerid ) , Velocidade [ 0 ] , Velocidade [ 1 ] , Velocidade [ 2 ] ) ;
- return IsPlayerInAnyVehicle ( playerid ) ? floatround ( ( ( floatsqroot ( ( ( Velocidade [ 0 ] * Velocidade [ 0 ] ) + ( Velocidade [ 1 ] * Velocidade [ 1 ] ) + ( Velocidade [ 2 ] * Velocidade [ 2 ] ) ) ) * ( !mode ? 105.0 : 170.0 ) ) ) * 1 ) : 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement