SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese > Lançamentos/Releases

Reply
 
Thread Tools Display Modes
Old 04/11/2012, 07:26 PM   #1
Don_Speed
High-roller
 
Don_Speed's Avatar
 
Join Date: Sep 2011
Location: Curitiba / PR
Posts: 3,273
Reputation: 266
Default DS-Velocimetro

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
http://img821.imageshack.us/img821/6048/samp004gg.png


Bom o code esta ai \/

pawn Code:
#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.
__________________
Youtubar
Discord : Don_Speed#6282
Don_Speed is offline   Reply With Quote
Old 04/11/2012, 07:29 PM   #2
Kuddy
High-roller
 
Kuddy's Avatar
 
Join Date: Jun 2011
Location: Brasil / Paraná
Posts: 2,876
Reputation: 313
Default Re: DS-Velocimetro

Ruin com N?

Nada profissional.

Achei muito simples esse velocímetro.
__________________
"CRIANÇÃ GAMER OTAKO QUE SOFREU BULLYING NA ESCOLA E AINDA É BV"
Kuddy is offline   Reply With Quote
Old 04/11/2012, 07:31 PM   #3
Sky™
High-roller
 
Sky™'s Avatar
 
Join Date: Aug 2012
Location: Apple Computer™
Posts: 1,782
Reputation: 351
Default Re: DS-Velocimetro

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
__________________
Sky™ is offline   Reply With Quote
Old 04/11/2012, 07:31 PM   #4
Parka
High-roller
 
Parka's Avatar
 
Join Date: Aug 2011
Location: Argentina
Posts: 1,666
Reputation: 318
Default Respuesta: DS-Velocimetro

simple 5/10
Parka is offline   Reply With Quote
Old 04/11/2012, 07:33 PM   #5
Don_Speed
High-roller
 
Don_Speed's Avatar
 
Join Date: Sep 2011
Location: Curitiba / PR
Posts: 3,273
Reputation: 266
Default Re: Respuesta: DS-Velocimetro

Quote:
Originally Posted by Kuddy View Post
Ruin com N?

Nada profissional.

Achei muito simples esse velocímetro.
Hehe nem tinha reparado!
Quote:
Originally Posted by Sky_. View Post
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_****** View Post
simple 5/10
Valew mano
__________________
Youtubar
Discord : Don_Speed#6282
Don_Speed is offline   Reply With Quote
Old 04/11/2012, 07:39 PM   #6
leonardo1434
High-roller
 
leonardo1434's Avatar
 
Join Date: Mar 2012
Posts: 1,667
Reputation: 179
Default Re: DS-Velocimetro

Meu deus, Que desperdício. usaste 2000 textdraw em uma coisa assim. Parabéns por fazer um script sem otimização e bem simples. -.-"
__________________
c++
leonardo1434 is offline   Reply With Quote
Old 04/11/2012, 07:41 PM   #7
Parka
High-roller
 
Parka's Avatar
 
Join Date: Aug 2011
Location: Argentina
Posts: 1,666
Reputation: 318
Default Respuesta: DS-Velocimetro

excluir........
Parka is offline   Reply With Quote
Old 04/11/2012, 07:43 PM   #8
Parka
High-roller
 
Parka's Avatar
 
Join Date: Aug 2011
Location: Argentina
Posts: 1,666
Reputation: 318
Default Respuesta: Re: DS-Velocimetro

Quote:
Originally Posted by leonardo1434 View Post
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.
Parka is offline   Reply With Quote
Old 04/11/2012, 07:46 PM   #9
Abravanel
Gangsta
 
Abravanel's Avatar
 
Join Date: Jan 2012
Location: Copacabana, RJ, Brazil
Posts: 783
Reputation: 116
Default Re: DS-Velocimetro

pawn Code:
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
__________________
Valente Brasil
Abravanel is offline   Reply With Quote
Old 04/11/2012, 07:48 PM   #10
leonardo1434
High-roller
 
leonardo1434's Avatar
 
Join Date: Mar 2012
Posts: 1,667
Reputation: 179
Default Re: Respuesta: Re: DS-Velocimetro

Quote:
Originally Posted by cesar_****** View Post
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
__________________
c++
leonardo1434 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Velocimetro Lipe_Stronda Lançamentos/Releases 12 11/01/2012 01:16 PM
[FilterScript] DTP - Velocimetro v1 SlashPT Lançamentos/Releases 53 29/07/2011 03:59 AM
[FilterScript] Velocimetro oakley Lançamentos/Releases 6 18/10/2010 10:02 PM
[FS] Velocimetro Serial_Killer Português/Portuguese 5 20/09/2010 01:21 AM


All times are GMT. The time now is 06:47 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.