[AJUDA] Velocimetro -
Maklister - 10.06.2012
► Ajuda Velocimetro ◄
Bom
Hoje Achei um Velocimetro muito Bom [Creditos: BlueX]
So Que Ele cria TextDraw somente para um Player No Caso eu
Tem como colocar para Quando o Player No Veiculo, crie a dele Sem Interfirir No dos Outros Players ?
Code \/ P.s: Nao coloquei Na Pasterbin pois Danifica a Dentaзгo
Код:
#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, "Veloc: 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, 50);
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, 50);
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, 50);
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, 70);
TextDrawTextSize(Textdraw5, 499.000000, 3.000000);
SetTimer("Speed", 100, true);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
Speed(playerid);
}
else if(oldstate == PLAYER_STATE_DRIVER)
{
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),"Veloc: %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;
}
e Jб Evitando novo Topicou ou Double Post
Alguem tem um Link Para eu Baixar o TextDrawEditor Da Zamaroth Sem Ser da Soldfires << Ta Bugado
Desde jб Obrigado
Re: [AJUDA] Velocimetro -
Maklister - 10.06.2012
Nao Queria Double Post Mas Ninguem Me ajudou e Nao consigo arrumar
Jб Tentei ******
Re: [AJUDA] Velocimetro -
ViictorDaay- - 10.06.2012
pawn Код:
#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, "Veloc: 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[playerid] = TextDrawCreate(640.000000, 329.000000, "_");
TextDrawBackgroundColor(Textdraw1[playerid], 255);
TextDrawFont(Textdraw1[playerid], 3);
TextDrawLetterSize(Textdraw1[playerid], 0.280000, 1.000000);
TextDrawColor(Textdraw1[playerid], 16777215);
TextDrawSetOutline(Textdraw1[playerid], 1);
TextDrawSetProportional(Textdraw1[playerid], 1);
TextDrawUseBox(Textdraw1[playerid], 1);
TextDrawBoxColor(Textdraw1[playerid], 50);
TextDrawTextSize(Textdraw1[playerid], 499.000000, 3.000000);
Textdraw2[playerid] = TextDrawCreate(640.000000, 315.000000, "_");
TextDrawBackgroundColor(Textdraw2[playerid], 255);
TextDrawFont(Textdraw2[playerid], 3);
TextDrawLetterSize(Textdraw2[playerid], 0.280000, 1.000000);
TextDrawColor(Textdraw2[playerid], 16777215);
TextDrawSetOutline(Textdraw2[playerid], 1);
TextDrawSetProportional(Textdraw2[playerid], 1);
TextDrawUseBox(Textdraw2[playerid], 1);
TextDrawBoxColor(Textdraw2, 50);
TextDrawTextSize(Textdraw2, 499.000000, 3.000000);
Textdraw3[playerid] = TextDrawCreate(640.000000, 343.000000, "_");
TextDrawBackgroundColor(Textdraw3[playerid], 255);
TextDrawFont(Textdraw3[playerid], 3);
TextDrawLetterSize(Textdraw3[playerid], 0.280000, 1.000000);
TextDrawColor(Textdraw3[playerid], 16777215);
TextDrawSetOutline(Textdraw3[playerid], 1);
TextDrawSetProportional(Textdraw3[playerid], 1);
TextDrawUseBox(Textdraw3[playerid], 1);
TextDrawBoxColor(Textdraw3[playerid], 50);
TextDrawTextSize(Textdraw3[playerid], 499.000000, 3.000000);
Textdraw[playerid]5 = TextDrawCreate(640.000000, 349.000000, "_");
TextDrawBackgroundColor(Textdraw5[playerid], 255);
TextDrawFont(Textdraw5[playerid], 3);
TextDrawLetterSize(Textdraw5[playerid], 0.280000, 1.000000);
TextDrawColor(Textdraw5[playerid], 16777215);
TextDrawSetOutline(Textdraw5[playerid], 1);
TextDrawSetProportional(Textdraw5[playerid], 1);
TextDrawUseBox(Textdraw5[playerid], 1);
TextDrawBoxColor(Textdraw5[playerid], 70);
TextDrawTextSize(Textdraw5[playerid], 499.000000, 3.000000);
SetTimer("Speed", 100, true);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
Speed(playerid);
}
else if(oldstate == PLAYER_STATE_DRIVER)
{
TextDrawHideForPlayer(playerid, Textdraw0[playerid]);
TextDrawHideForPlayer(playerid, Textdraw1[playerid]);
TextDrawHideForPlayer(playerid, Textdraw2[playerid]);
TextDrawHideForPlayer(playerid, Textdraw3[playerid]);
TextDrawHideForPlayer(playerid, Textdraw4[playerid]);
TextDrawHideForPlayer(playerid, Textdraw5[playerid]);
}
return 1;
}
Speed(playerid);
public Speed(playerid)
{
new MySpeed[48];
new MyCar[48];
format(MySpeed,sizeof(MySpeed),"Veloc: %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[playerid]);
TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
TextDrawShowForPlayer(playerid, Textdraw3[playerid]);
TextDrawShowForPlayer(playerid, Textdraw4[playerid]);
TextDrawShowForPlayer(playerid, Textdraw5[playerid]);
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: [AJUDA] Velocimetro -
Maklister - 10.06.2012
No Seu Deu esse Erro:
Код:
C:\Documents and Settings\Murilo de sousa\Desktop\BRASIL RPG 2012\filterscripts\Speed.pwn(62) : error 028: invalid subscript (not an array or too many subscripts): "Textdraw1"
C:\Documents and Settings\Murilo de sousa\Desktop\BRASIL RPG 2012\filterscripts\Speed.pwn(62) : error 017: undefined symbol "playerid"
C:\Documents and Settings\Murilo de sousa\Desktop\BRASIL RPG 2012\filterscripts\Speed.pwn(62) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Murilo de sousa\Desktop\BRASIL RPG 2012\filterscripts\Speed.pwn(62) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Re: [AJUDA] Velocimetro -
ViictorDaay- - 10.06.2012
manda a linha.
Re: [AJUDA] Velocimetro -
Schocc - 11.06.2012
Sу uma dica Velocimetros da causa lag no server se tiver muitos Players olhe quantos Timers vai ativar
Re: [AJUDA] Velocimetro -
Maklister - 11.06.2012
Por Favor
por que Tipo o Velocimetro й Basico e Contem apenas Velocidade e Modelo do Veiculo
Se Alguem Me ajudar Fico grato
+ UP
Re: [AJUDA] Velocimetro -
Schocc - 11.06.2012
Й sу vocк colocar um loop e resolvera tudo
Re: [AJUDA] Velocimetro -
Maklister - 11.06.2012
Quote:
Originally Posted by Schocc
Й sу vocк colocar um loop e resolvera tudo
|
Hun .. To comeзando a Intender se nao me Engano loop e o que Faz Criar a TextDraw para Cada Player on Neh ?
Tem Como Colocar no Codigo Que postei lб Encima ?
@OFF Ainda sou Meio Novato e Tendo ajudar no que sei mais Peзa mais ajuda do que ajudo rsrsrs
Desde jб Obrigado ae