SA-MP Forums Archive
[FilterScript] BlueXSpeed - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+----- Forum: Lançamentos/Releases (https://sampforum.blast.hk/forumdisplay.php?fid=56)
+----- Thread: [FilterScript] BlueXSpeed (/showthread.php?tid=284372)

Pages: 1 2


BlueXSpeed - RebeloX - 18.09.2011




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

pawn Код:
/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XX                                                                            XX
XX                             [BXS]                                          XX
XX                      [Creditos: BlueX]                                     XX
XX                                                                            XX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/

#include <a_samp>

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()
{
    print("Velocimetro by: BlueX");

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

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

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

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

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

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

    return 1;
}

public OnFilterScriptExit()
{
    TextDrawHideForAll(Textdraw0);
    TextDrawDestroy(Textdraw0);
    TextDrawHideForAll(Textdraw1);
    TextDrawDestroy(Textdraw1);
    TextDrawHideForAll(Textdraw2);
    TextDrawDestroy(Textdraw2);
    TextDrawHideForAll(Textdraw3);
    TextDrawDestroy(Textdraw3);
    TextDrawHideForAll(Textdraw4);
    TextDrawDestroy(Textdraw4);
    TextDrawHideForAll(Textdraw5);
    TextDrawDestroy(Textdraw5);
    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);
        TextDrawHideForPlayer(playerid, Textdraw3);
        TextDrawHideForPlayer(playerid, Textdraw4);
        TextDrawHideForPlayer(playerid, Textdraw5);
    }
    return 1;
}
Speed(playerid);
public Speed(playerid)
{
    new MySpeed[48];
    new MyCar[48];
    format(MySpeed,sizeof(MySpeed),"Velocidade: %d Km/h",GetSpeed(playerid));
    format(MyCar,sizeof(MyCar),"Veiculo: %s",veiculos[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
    TextDrawSetString(Textdraw0, MySpeed);
    TextDrawSetString(Textdraw4, MyCar);
    TextDrawShowForPlayer(playerid, Textdraw0);
    TextDrawShowForPlayer(playerid, Textdraw1);
    TextDrawShowForPlayer(playerid, Textdraw2);
    TextDrawShowForPlayer(playerid, Textdraw3);
    TextDrawShowForPlayer(playerid, Textdraw4);
    TextDrawShowForPlayer(playerid, Textdraw5);
    SetTimerEx("Speed",1,0,"i",playerid);
}
stock
    GetSpeed ( playerid , mode = 1 )
{
    GetVehicleVelocity ( GetPlayerVehicleID ( playerid ) , poskm [ 0 ] , poskm [ 1 ] , poskm [ 2 ] ) ;
    return IsPlayerInAnyVehicle ( playerid ) ? floatround ( ( ( floatsqroot ( ( ( poskm [ 0 ] * poskm [ 0 ] ) + ( poskm [ 1 ] * poskm [ 1 ] ) + ( poskm [ 2 ] * poskm [ 2 ] ) ) ) * ( !mode ? 105.0 : 170.0 ) ) ) * 1 ) : 0;
}
AVISO: nгo postei pastebin pq estraga a indentaзгo, espero que gostem (:

Download



Re: BlueXSpeed - [O.z]Caroline - 18.09.2011

muito bom seu trabalho, parabйns!.
sу uma dъvida,
pawn Код:
SetTimerEx("Speed",1,0,"i",playerid);
isto nгo causarб lag ?


Re: BlueXSpeed - BrunoBSF - 18.09.2011

Gostei pakas mais na proxima versao faiz o text mais infeitado


Re: BlueXSpeed - Bruno Pereira - 18.09.2011

O SetTimer vai causar lag.
E estб errado.
Porque o velocimetro tem que ser para cada player.
[MAX_PLAYERS];


Re: BlueXSpeed - MiTToS - 18.09.2011

Quote:
Originally Posted by Bruno Pereira
Посмотреть сообщение
O SetTimer vai causar lag.
E estб errado.
Porque o velocimetro tem que ser para cada player.
[MAX_PLAYERS];
Exato, cada player precisa ter uma textdraw prуprio, ou pode acontecer de bugar as informaзхes, tipo eu obter o resultado do Bruno.


Re: BlueXSpeed - [O.z]Caroline - 18.09.2011

ACredito que assim nгo causarб lag:
pawn Код:
/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XX                                                                            XX
XX                             [BXS]                                          XX
XX                      [Creditos: BlueX]                                     XX
XX                                                                            XX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/

#include <a_samp>

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

new 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()
{
    print("Velocimetro by: BlueX");

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

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

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

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

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

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

    SetTimer("Speed", 1000, true);
    return 1;
}

public OnFilterScriptExit()
{
    TextDrawHideForAll(Textdraw0);
    TextDrawDestroy(Textdraw0);
    TextDrawHideForAll(Textdraw1);
    TextDrawDestroy(Textdraw1);
    TextDrawHideForAll(Textdraw2);
    TextDrawDestroy(Textdraw2);
    TextDrawHideForAll(Textdraw3);
    TextDrawDestroy(Textdraw3);
    TextDrawHideForAll(Textdraw4);
    TextDrawDestroy(Textdraw4);
    TextDrawHideForAll(Textdraw5);
    TextDrawDestroy(Textdraw5);
    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);
        TextDrawHideForPlayer(playerid, Textdraw3);
        TextDrawHideForPlayer(playerid, Textdraw4);
        TextDrawHideForPlayer(playerid, Textdraw5);
    }
    return 1;
}
Speed(playerid);
public Speed(playerid)
{
    new MySpeed[48];
    new MyCar[48];
    format(MySpeed,sizeof(MySpeed),"Velocidade: %d Km/h",GetSpeed(playerid));
    format(MyCar,sizeof(MyCar),"Veiculo: %s",veiculos[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
    TextDrawSetString(Textdraw0, MySpeed);
    TextDrawSetString(Textdraw4, MyCar);
    TextDrawShowForPlayer(playerid, Textdraw0);
    TextDrawShowForPlayer(playerid, Textdraw1);
    TextDrawShowForPlayer(playerid, Textdraw2);
    TextDrawShowForPlayer(playerid, Textdraw3);
    TextDrawShowForPlayer(playerid, Textdraw4);
    TextDrawShowForPlayer(playerid, Textdraw5);
    return 1;
}
stock
    GetSpeed ( playerid , mode = 1 )
{
    GetVehicleVelocity ( GetPlayerVehicleID ( playerid ) , poskm [ 0 ] , poskm [ 1 ] , poskm [ 2 ] ) ;
    return IsPlayerInAnyVehicle ( playerid ) ? floatround ( ( ( floatsqroot ( ( ( poskm [ 0 ] * poskm [ 0 ] ) + ( poskm [ 1 ] * poskm [ 1 ] ) + ( poskm [ 2 ] * poskm [ 2 ] ) ) ) * ( !mode ? 105.0 : 170.0 ) ) ) * 1 ) : 0;
}
Por favor, me corrijam caso eu estiver errada *------*


Re: BlueXSpeed - [R] ousenber [K] - 18.09.2011

/\ Mas de qualquer jeito tem que ser para cada player e tem de ser SetTimerEx ...


E ta legal o Velo


Re: BlueXSpeed - [O.z]Caroline - 18.09.2011

seria isto ?
pawn Код:
/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XX                                                                            XX
XX                             [BXS]                                          XX
XX                      [Creditos: BlueX]                                     XX
XX                                                                            XX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/

#include <a_samp>

new Text:Textdraw0[MAX_PLAYERS];
new Text:Textdraw1;
new Text:Textdraw2;
new Text:Textdraw3;
new Text:Textdraw4[MAX_PLAYERS];
new Text:Textdraw5;

new 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()
{
    print("Velocimetro by: BlueX");

    // Create the textdraws:
    for(new playerid; playerid < MAX_PLAYERS; ++playerid)
    {
        Textdraw0[playerid] = TextDrawCreate(517.000000, 324.000000, "Velocidade: Km/h");
        TextDrawBackgroundColor(Textdraw0[playerid], -16776961);
        TextDrawFont(Textdraw0[playerid], 2);
        TextDrawLetterSize(Textdraw0[playerid], 0.280000, 1.000000);
        TextDrawColor(Textdraw0[playerid], -1);
        TextDrawSetOutline(Textdraw0[playerid], 0);
        TextDrawSetProportional(Textdraw0[playerid], 1);
        TextDrawSetShadow(Textdraw0[playerid], 1);
       
        Textdraw4[playerid] = TextDrawCreate(517.000000, 337.000000, "Veiculo:");
        TextDrawBackgroundColor(Textdraw4[playerid], -16776961);
        TextDrawFont(Textdraw4[playerid], 2);
        TextDrawLetterSize(Textdraw4[playerid], 0.280000, 1.000000);
        TextDrawColor(Textdraw4[playerid], -1);
        TextDrawSetOutline(Textdraw4[playerid], 0);
        TextDrawSetProportional(Textdraw4[playerid], 1);
        TextDrawSetShadow(Textdraw4[playerid], 1);
    }

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

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

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

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

    SetTimer("Speed", 1000, true);
    return 1;
}

public OnFilterScriptExit()
{
    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[playerid]);
        TextDrawHideForPlayer(playerid, Textdraw1);
        TextDrawHideForPlayer(playerid, Textdraw2);
        TextDrawHideForPlayer(playerid, Textdraw3);
        TextDrawHideForPlayer(playerid, Textdraw4[playerid]);
        TextDrawHideForPlayer(playerid, Textdraw5);
    }
    return 1;
}
Speed(playerid);
public Speed(playerid)
{
    new MySpeed[48];
    new MyCar[48];
    format(MySpeed,sizeof(MySpeed),"Velocidade: %d Km/h",GetSpeed(playerid));
    format(MyCar,sizeof(MyCar),"Veiculo: %s",veiculos[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
    TextDrawSetString(Textdraw0[playerid], MySpeed);
    TextDrawSetString(Textdraw4[playerid], MyCar);
    TextDrawShowForPlayer(playerid, Textdraw0[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw1);
    TextDrawShowForPlayer(playerid, Textdraw2);
    TextDrawShowForPlayer(playerid, Textdraw3);
    TextDrawShowForPlayer(playerid, Textdraw4[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw5);
    return 1;
}
stock
    GetSpeed ( playerid , mode = 1 )
{
    GetVehicleVelocity ( GetPlayerVehicleID ( playerid ) , poskm [ 0 ] , poskm [ 1 ] , poskm [ 2 ] ) ;
    return IsPlayerInAnyVehicle ( playerid ) ? floatround ( ( ( floatsqroot ( ( ( poskm [ 0 ] * poskm [ 0 ] ) + ( poskm [ 1 ] * poskm [ 1 ] ) + ( poskm [ 2 ] * poskm [ 2 ] ) ) ) * ( !mode ? 105.0 : 170.0 ) ) ) * 1 ) : 0;
}



Re: BlueXSpeed - [R] ousenber [K] - 18.09.2011

Quote:
Originally Posted by [O.z]Caroline
Посмотреть сообщение
seria isto ?
pawn Код:
/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XX                                                                            XX
XX                             [BXS]                                          XX
XX                      [Creditos: BlueX]                                     XX
XX                                                                            XX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/

#include <a_samp>

new Text:Textdraw0[MAX_PLAYERS];
new Text:Textdraw1;
new Text:Textdraw2;
new Text:Textdraw3;
new Text:Textdraw4[MAX_PLAYERS];
new Text:Textdraw5;

new 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()
{
    print("Velocimetro by: BlueX");

    // Create the textdraws:
    for(new playerid; playerid < MAX_PLAYERS; ++playerid)
    {
        Textdraw0[playerid] = TextDrawCreate(517.000000, 324.000000, "Velocidade: Km/h");
        TextDrawBackgroundColor(Textdraw0[playerid], -16776961);
        TextDrawFont(Textdraw0[playerid], 2);
        TextDrawLetterSize(Textdraw0[playerid], 0.280000, 1.000000);
        TextDrawColor(Textdraw0[playerid], -1);
        TextDrawSetOutline(Textdraw0[playerid], 0);
        TextDrawSetProportional(Textdraw0[playerid], 1);
        TextDrawSetShadow(Textdraw0[playerid], 1);
       
        Textdraw4[playerid] = TextDrawCreate(517.000000, 337.000000, "Veiculo:");
        TextDrawBackgroundColor(Textdraw4[playerid], -16776961);
        TextDrawFont(Textdraw4[playerid], 2);
        TextDrawLetterSize(Textdraw4[playerid], 0.280000, 1.000000);
        TextDrawColor(Textdraw4[playerid], -1);
        TextDrawSetOutline(Textdraw4[playerid], 0);
        TextDrawSetProportional(Textdraw4[playerid], 1);
        TextDrawSetShadow(Textdraw4[playerid], 1);
    }

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

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

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

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

    SetTimer("Speed", 1000, true);
    return 1;
}

public OnFilterScriptExit()
{
    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[playerid]);
        TextDrawHideForPlayer(playerid, Textdraw1);
        TextDrawHideForPlayer(playerid, Textdraw2);
        TextDrawHideForPlayer(playerid, Textdraw3);
        TextDrawHideForPlayer(playerid, Textdraw4[playerid]);
        TextDrawHideForPlayer(playerid, Textdraw5);
    }
    return 1;
}
Speed(playerid);
public Speed(playerid)
{
    new MySpeed[48];
    new MyCar[48];
    format(MySpeed,sizeof(MySpeed),"Velocidade: %d Km/h",GetSpeed(playerid));
    format(MyCar,sizeof(MyCar),"Veiculo: %s",veiculos[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
    TextDrawSetString(Textdraw0[playerid], MySpeed);
    TextDrawSetString(Textdraw4[playerid], MyCar);
    TextDrawShowForPlayer(playerid, Textdraw0[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw1);
    TextDrawShowForPlayer(playerid, Textdraw2);
    TextDrawShowForPlayer(playerid, Textdraw3);
    TextDrawShowForPlayer(playerid, Textdraw4[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw5);
    return 1;
}
stock
    GetSpeed ( playerid , mode = 1 )
{
    GetVehicleVelocity ( GetPlayerVehicleID ( playerid ) , poskm [ 0 ] , poskm [ 1 ] , poskm [ 2 ] ) ;
    return IsPlayerInAnyVehicle ( playerid ) ? floatround ( ( ( floatsqroot ( ( ( poskm [ 0 ] * poskm [ 0 ] ) + ( poskm [ 1 ] * poskm [ 1 ] ) + ( poskm [ 2 ] * poskm [ 2 ] ) ) ) * ( !mode ? 105.0 : 170.0 ) ) ) * 1 ) : 0;
}
Acho q sim kkk to com preguiзa hj, e vi so q o settimer teria q ser em OnPlayerStateChange e teria que ser SetTimerEx


Re: BlueXSpeed - Juninho_Oakley - 18.09.2011

Boa Man Parabens Vlw Por Compartilhar


Re: BlueXSpeed - [O.z]Caroline - 18.09.2011

seu release й muito bom,
mais se alguйm usar realmente com mais de um player, poderб ter problemas ...


Re: BlueXSpeed - RebeloX - 19.09.2011

eu sу testei comigo '-', mas usei um settimer por um simples motivo, para atualizar a velocidade atual do player, nada mais, em vez de usar a public on player update eu usei o timer xD, isso й uma versгo beta ainda xD.

Obrigado a todos (:


Re: BlueXSpeed - Macintosh - 19.09.2011

Parabйns, trabalho eficiente hugs ^^


Re: BlueXSpeed - Vai_Besta - 19.09.2011

daora


Re: BlueXSpeed - [O.z]Caroline - 19.09.2011

sу me tira uma dъvida,
vocк irб atualisar ?


Re: BlueXSpeed - CaioMors - 19.09.2011

Otimo (:


Re: BlueXSpeed - RebeloX - 19.09.2011

Quote:
Originally Posted by [O.z]Caroline
Посмотреть сообщение
sу me tira uma dъvida,
vocк irб atualisar ?
Sim, irei fazer umas coisas muito boas (: Aceito sugestхes (:


Re: BlueXSpeed - Jason_King - 19.09.2011

Massa, venho procurando isso a vбrios dias. Obrigado BlueX, ainda vou testar.


Re: BlueXSpeed - Joao_VS - 19.09.2011

Quote:
Originally Posted by [O.z]Caroline
Посмотреть сообщение
vocк irб atualisar ?
Talvez ele atualiZe! xP

@TOPIC
Good Fucking Job!
Код:
This forum requires that you wait 120 seconds between posts. Please try again in 4 seconds.



Re: BlueXSpeed - RebeloX - 19.09.2011

Ei vou fazer um update, a minha atualizaзгo serб a seguinte.

Quote:
Originally Posted by BlueX
3 Tipos de Velocimetros, 1є - Para carros/motos, 2є - Para carros policiais, 3є - Aviхes, jб fiz o 1є xD , em breve irei atualizar (: