Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- new Text:velocimetro[MAX_PLAYERS],
- Text:BoxVelcimetro[MAX_PLAYERS],
- Text:Velocidade[MAX_PLAYERS],
- Text:Foto[MAX_PLAYERS],
- Text:Veiculo[MAX_PLAYERS],
- Text:ModeloCarro[MAX_PLAYERS],
- PlayerText:FotoCarro;
- forward Velocimetro();
- new NomeCarro[212][] =
- {
- "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel", "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana",
- "Infernus", "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam", "Esperanto", "Taxi", "Washington", "Bobcat",
- "Whoopee", "BF Injection", "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus", "Rhino", "Barracks", "Hotknife",
- "Trailer 1", "Previon", "Coach", "Cabbie", "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral", "Squalo",
- "Seasparrow", "Pizzaboy", "Tram", "Trailer 2", "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", "ZR-350", "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", "Cropduster","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 LA", "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 Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper", "Broadway",
- "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400", "News Van", "Tug", "Trailer 3", "Emperor", "Wayfarer", "Euros", "Hotdog",
- "Club", "Freight Carriage", "Trailer 4", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car (LSPD)", "Police Car (SFPD)",
- "Police Car (LVPD)", "Police Ranger", "Picador", "S.W.A.T", "Alpha", "Phoenix", "Glendale", "Sadler", "Luggage Trailer A",
- "Luggage Trailer B", "Stairs", "BoxVille", "Tiller", "Utility Trailer"
- };
- public OnGameModeInit()
- {
- print("==================================================");
- print("======== VELOCIMETRO CARREGADO COM SUCESSO =======");
- print("===== BY: [RoXx]Okiinho_. e Cantiliano_. ========");
- print("==================================================");
- SetTimer("Velocimetro", 1, 1);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- velocimetro[playerid] = TextDrawCreate(262.000000, 383.000000, "130 km/h");
- TextDrawBackgroundColor(velocimetro[playerid], -16776961);
- TextDrawFont(velocimetro[playerid], 2);
- TextDrawLetterSize(velocimetro[playerid], 0.419997, 3.099997);
- TextDrawColor(velocimetro[playerid], -65281);
- TextDrawSetOutline(velocimetro[playerid], 1);
- TextDrawSetProportional(velocimetro[playerid], 1);
- TextDrawSetSelectable(velocimetro[playerid], 0);
- BoxVelcimetro[playerid] = TextDrawCreate(441.000000, 367.000000, "~n~");
- TextDrawBackgroundColor(BoxVelcimetro[playerid], 255);
- TextDrawFont(BoxVelcimetro[playerid], 1);
- TextDrawLetterSize(BoxVelcimetro[playerid], 1.709998, 6.199995);
- TextDrawColor(BoxVelcimetro[playerid], -1);
- TextDrawSetOutline(BoxVelcimetro[playerid], 0);
- TextDrawSetProportional(BoxVelcimetro[playerid], 1);
- TextDrawSetShadow(BoxVelcimetro[playerid], 1);
- TextDrawUseBox(BoxVelcimetro[playerid], 1);
- TextDrawBoxColor(BoxVelcimetro[playerid], 102);
- TextDrawTextSize(BoxVelcimetro[playerid], 170.000000, -3.000000);
- TextDrawSetSelectable(BoxVelcimetro[playerid], 0);
- Velocidade[playerid] = TextDrawCreate(267.000000, 365.000000, "Velocidade");
- TextDrawBackgroundColor(Velocidade[playerid], 255);
- TextDrawFont(Velocidade[playerid], 2);
- TextDrawLetterSize(Velocidade[playerid], 0.250000, 1.800001);
- TextDrawColor(Velocidade[playerid], -1);
- TextDrawSetOutline(Velocidade[playerid], 1);
- TextDrawSetProportional(Velocidade[playerid], 1);
- TextDrawSetSelectable(Velocidade[playerid], 0);
- Foto[playerid] = TextDrawCreate(193.000000, 366.000000, "FOTO");
- TextDrawBackgroundColor(Foto[playerid], 255);
- TextDrawFont(Foto[playerid], 2);
- TextDrawLetterSize(Foto[playerid], 0.319999, 1.799999);
- TextDrawColor(Foto[playerid], -1);
- TextDrawSetOutline(Foto[playerid], 0);
- TextDrawSetProportional(Foto[playerid], 1);
- TextDrawSetShadow(Foto[playerid], 1);
- TextDrawSetSelectable(Foto[playerid], 0);
- Veiculo[playerid] = TextDrawCreate(366.000000, 365.000000, "Veiculo");
- TextDrawBackgroundColor(Veiculo[playerid], 255);
- TextDrawFont(Veiculo[playerid], 2);
- TextDrawLetterSize(Veiculo[playerid], 0.319999, 1.799999);
- TextDrawColor(Veiculo[playerid], -1);
- TextDrawSetOutline(Veiculo[playerid], 0);
- TextDrawSetProportional(Veiculo[playerid], 1);
- TextDrawSetShadow(Veiculo[playerid], 1);
- TextDrawSetSelectable(Veiculo[playerid], 0);
- ModeloCarro[playerid] = TextDrawCreate(356.000000, 391.000000, "_");
- TextDrawBackgroundColor(ModeloCarro[playerid], 255);
- TextDrawFont(ModeloCarro[playerid], 2);
- TextDrawLetterSize(ModeloCarro[playerid], 0.250000, 1.200000);
- TextDrawColor(ModeloCarro[playerid], -1);
- TextDrawSetOutline(ModeloCarro[playerid], 1);
- TextDrawSetProportional(ModeloCarro[playerid], 1);
- TextDrawSetSelectable(ModeloCarro[playerid], 0);
- FotoCarro = CreatePlayerTextDraw(playerid, 192.000000, 384.000000, "_");
- PlayerTextDrawFont(playerid, FotoCarro, TEXT_DRAW_FONT_MODEL_PREVIEW);
- PlayerTextDrawTextSize(playerid, FotoCarro, 40.0, 40.0);
- PlayerTextDrawSetPreviewModel(playerid, FotoCarro, 400);
- PlayerTextDrawSetPreviewRot(playerid, FotoCarro, -10.0, 0.0, -20.0, 1.0);
- return true;
- }
- public Velocimetro()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- new aname[MAX_PLAYER_NAME];
- GetPlayerName(i, aname, MAX_PLAYER_NAME);
- if(IsPlayerInAnyVehicle(i))
- {
- new Float:X, Float:Y, Float:Z, Float:Speed;
- GetVehicleVelocity(GetPlayerVehicleID(i), X, Y, Z);
- Speed = floatmul(floatsqroot(floatadd(floatadd(floatpower(X, 2), floatpower(Y, 2)), floatpower(Z, 2))), 200.0);
- new Float:vcarro;
- GetVehicleHealth(GetPlayerVehicleID(i), vcarro);
- new velocidade;
- velocidade = floatround(Speed, floatround_floor);
- new string[128];
- new PlayerVehicleModelID = GetVehicleModel(GetPlayerVehicleID(i));
- PlayerVehicleModelID -= 400;
- new nocarro[30];
- format(nocarro,30,NomeCarro[PlayerVehicleModelID]);
- format(string, 128,"%s",nocarro);
- TextDrawSetString(ModeloCarro[i], string);
- format(string, 128,"%i KM/H",velocidade);
- TextDrawSetString(velocimetro[i], string);
- TextDrawShowForPlayer(i, velocimetro[i]);
- TextDrawShowForPlayer(i, BoxVelcimetro[i]);
- TextDrawShowForPlayer(i, Velocidade[i]);
- TextDrawShowForPlayer(i, Foto[i]);
- TextDrawShowForPlayer(i, Veiculo[i]);
- TextDrawShowForPlayer(i, ModeloCarro[i]);
- }
- else
- {
- TextDrawHideForPlayer(i, velocimetro[i]);
- TextDrawHideForPlayer(i, BoxVelcimetro[i]);
- TextDrawHideForPlayer(i, Velocidade[i]);
- TextDrawHideForPlayer(i, Foto[i]);
- TextDrawHideForPlayer(i, Veiculo[i]);
- TextDrawHideForPlayer(i, ModeloCarro[i]);
- }
- }
- }
- return true;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- PlayerTextDrawHide(playerid, FotoCarro);
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- new vid = GetPlayerVehicleID(playerid);
- if(newstate == PLAYER_STATE_DRIVER)
- {
- PlayerTextDrawSetPreviewModel(playerid, FotoCarro, GetVehicleModel(vid));
- PlayerTextDrawShow(playerid, FotoCarro);
- }
- else
- {
- PlayerTextDrawHide(playerid, FotoCarro);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement