[FilterScript] DS-Velocimetro
#1

Olб sou Don_Speed e venho postar este velocimetro.

Bom creio que ele e mais para servidores de caminhao !
Fiz hoje de manha .
Ele marca :
Velocidade
Lataria
Nome do veiculo
Ibagen
/imageshack/img821/6048/samp004gg.png


Bom o code esta ai \/

pawn Код:
#include            a_samp
new Text:Textdraw0[MAX_PLAYERS];
new Text:Textdraw1[MAX_PLAYERS];
new Text:Textdraw2[MAX_PLAYERS];
new Text:Textdraw3[MAX_PLAYERS];
new TimerVelocimetro[MAX_PLAYERS];
new vehName[][] ={
"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()
{
    for(new x = 0; x < MAX_PLAYERS; x++){

    Textdraw0[x] = TextDrawCreate(548.000000, 350.000000, "");// Velocidade
    TextDrawBackgroundColor(Textdraw0[x], 255);
    TextDrawFont(Textdraw0[x], 2);
    TextDrawLetterSize(Textdraw0[x], 0.569999, 3.999998);
    TextDrawColor(Textdraw0[x], -1);
    TextDrawSetOutline(Textdraw0[x], 0);
    TextDrawSetProportional(Textdraw0[x], 1);
    TextDrawSetShadow(Textdraw0[x], 1);

    Textdraw1[x] = TextDrawCreate(600.000000, 350.000000, "KM");// KM
    TextDrawBackgroundColor(Textdraw1[x], 255);
    TextDrawFont(Textdraw1[x], 2);
    TextDrawLetterSize(Textdraw1[x], 0.210000, 1.300000);
    TextDrawColor(Textdraw1[x], -1);
    TextDrawSetOutline(Textdraw1[x], 0);
    TextDrawSetProportional(Textdraw1[x], 1);
    TextDrawSetShadow(Textdraw1[x], 1);

    Textdraw2[x] = TextDrawCreate(519.000000, 389.000000, "");//Lataria
    TextDrawBackgroundColor(Textdraw2[x], 255);
    TextDrawFont(Textdraw2[x], 2);
    TextDrawLetterSize(Textdraw2[x], 0.220000, 1.800000);
    TextDrawColor(Textdraw2[x], -1);
    TextDrawSetOutline(Textdraw2[x], 0);
    TextDrawSetProportional(Textdraw2[x], 1);
    TextDrawSetShadow(Textdraw2[x], 1);

    Textdraw3[x] = TextDrawCreate(515.000000, 408.000000, "");// Veiculo
    TextDrawBackgroundColor(Textdraw3[x], 255);
    TextDrawFont(Textdraw3[x], 2);
    TextDrawLetterSize(Textdraw3[x], 0.280000, 1.500000);
    TextDrawColor(Textdraw3[x], -1);
    TextDrawSetOutline(Textdraw3[x], 0);
    TextDrawSetProportional(Textdraw3[x], 1);
    TextDrawSetShadow(Textdraw3[x], 1);
    }
    return 1;
}
public OnFilterScriptExit()
{
    return 1;
}
public OnPlayerConnect(playerid)
{
    return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    KillTimer(TimerVelocimetro[playerid]);
    return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        TimerVelocimetro[playerid] = SetTimerEx("AtualizarVelocimetro", 100, true, "n", playerid);
    }
    else if(oldstate == PLAYER_STATE_DRIVER)
    {
        KillTimer(TimerVelocimetro[playerid]);
        TextDrawHideForPlayer(playerid, Textdraw0[playerid]);
        TextDrawHideForPlayer(playerid, Textdraw1[playerid]);
        TextDrawHideForPlayer(playerid, Textdraw2[playerid]);
        TextDrawHideForPlayer(playerid, Textdraw3[playerid]);
    }
    return 1;
}
forward AtualizarVelocimetro(playerid);
public AtualizarVelocimetro(playerid)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        new Velo[30], Lat[30], Carronome[60];
       
        format(Velo, 30, "%i", GetPlayerSpeed(playerid));
        TextDrawSetString(Textdraw0[playerid], Velo);
        TextDrawShowForPlayer(playerid, Textdraw0[playerid]);

        TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
   
        new Float:Vidacarro;
        new veh = GetPlayerVehicleID(playerid);
        GetVehicleHealth(veh, Vidacarro);
   
        if(Vidacarro >= 900 ||Vidacarro <= 1000)format(Lat, 30, "Lataria: Excelente");
        if(Vidacarro >= 800 ||Vidacarro <= 899)format(Lat, 30, "Lataria: Bom");
        if(Vidacarro >= 500 ||Vidacarro <= 799)format(Lat, 30, "Lataria: Medio");
        if(Vidacarro >= 300 ||Vidacarro <= 499)format(Lat, 30, "Lataria: Ruim");
        if(Vidacarro >= 100 ||Vidacarro <= 399)format(Lat, 30, "Lataria: Pessimo");
        TextDrawSetString(Textdraw2[playerid], Lat);
        TextDrawShowForPlayer(playerid, Textdraw2[playerid]);

        format(Carronome, 60, "Veiculo: %s", vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
        TextDrawSetString(Textdraw3[playerid], Carronome);
        TextDrawShowForPlayer(playerid, Textdraw3[playerid]);
       
    }
    return 1;
}
stock GetPlayerSpeed(playerid)
{
    new Float:ST[4];
    if(IsPlayerInAnyVehicle(playerid))
    GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
    else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
    ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 100.3;
    return floatround(ST[3]);
}
Gostou Comenta ae.
Nao gostou Critica ae.
Reply
#2

Ruin com N?

Nada profissional.

Achei muito simples esse velocнmetro.
Reply
#3

Caramba eu achava que velocimetro era mó foda fazer quando iniciante mais agr que percebi o quanto eu era burro!

@Topico

fizesse uma box ia ficar melhor!

Bom! 8/10
Reply
#4

simple 5/10
Reply
#5

Quote:
Originally Posted by Kuddy
Посмотреть сообщение
Ruin com N?

Nada profissional.

Achei muito simples esse velocнmetro.
Hehe nem tinha reparado!
Quote:
Originally Posted by Sky_.
Посмотреть сообщение
Caramba eu achava que velocimetor era mу foda fazer quando iniciante mais agr que percebi o quanto eue ra burro!

@Topico

fizesse uma box ia ficar melhor!

Bom! 8/10
Tambem pensava que era foda , depois que o rjj me mostro como fazia percebi que era facil Vlw
Quote:
Originally Posted by cesar_******
Посмотреть сообщение
simple 5/10
Valew mano
Reply
#6

Meu deus, Que desperdнcio. usaste 2000 textdraw em uma coisa assim. Parabйns por fazer um script sem otimizaзгo e bem simples. -.-"
Reply
#7

excluir........
Reply
#8

Quote:
Originally Posted by leonardo1434
Посмотреть сообщение
Meu deus, Que desperdнcio. usaste 2000 textdraw em uma coisa assim. Parabйns por fazer um script sem otimizaзгo e bem simples. -.-"
eram, na verdade 2500.
Reply
#9

pawn Код:
if(Vidacarro >= 900 ||Vidacarro <= 1000)format(Lat, 30, "Lataria: Excelente");
if(Vidacarro >= 800 ||Vidacarro <= 899)format(Lat, 30, "Lataria: Bom");
if(Vidacarro >= 500 ||Vidacarro <= 799)format(Lat, 30, "Lataria: Medio");
if(Vidacarro >= 300 ||Vidacarro <= 499)format(Lat, 30, "Lataria: Ruim");
if(Vidacarro >= 100 ||Vidacarro <= 399)format(Lat, 30, "Lataria: Pessimo");
//
switch(Vidacarro) {
    case 900 .. 1000: Lat = "Lataria: Execelente";
    case 800 .. 899: Lat = "Lataria: Bom";
    //...
}
Tem mais coisas ai que poderiam ser melhoradas ... rs
Reply
#10

Quote:
Originally Posted by cesar_******
Посмотреть сообщение
eram, na verdade 2500.
Me referi ao que esta dentro do loop, o limite do samp й 2048 textdraw's globais, sу ai, ele criou 2000.

E tambйm, esses "ou" condicionais Tгo uma maravilha ! KKKK
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)