[Ajuda] Velocimetro.
#1

Eu tenhu um velocimetro, sу que em vez de mostra o gбs, ele mostra a Altitude.

Eu editei tudo e tals, so que nгo sei como trocar Altitude para mostra o Gбs do carro.

Alguem "Pode ajudar?"


Quote:

/***********************************
* By: Menord2 *
* Version 1 *
* Creator: Menord2 *
* Script by Menord2 *
************************************/

#include <a_samp>

#define SLOTS 200

#define URL "www.brasilplaytwister.forumbrasil.net"

new Text:box[MAX_PLAYERS],Text:tacho[MAX_PLAYERS],Text:fahrzeug[MAX_PLAYERS],Text:mph[MAX_PLAYERS];
new Text:hoehe[MAX_PLAYERS],Text:zustand[MAX_PLAYERS],Text:url[MAX_PLAYERS];
new SpeedoON[MAX_PLAYERS];
new FloatVehicle_X[MAX_VEHICLES], FloatVehicle_Y[MAX_VEHICLES], FloatVehicle_Z[MAX_VEHICLES];

enum OldSpeedoPos
{
FloatX,
FloatY,
FloatZ
}

new SavePlayerPos[SLOTS][OldSpeedoPos];

new VehicleNames[][] =
{
"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", "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", "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", "Boxvillde", "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", "Hustler", "Intruder", "Primo",
"Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite",
"Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratium",
"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", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
"Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car",
"Police Car", "Police Car", "Police Ranger", "Picador", "S.W.A.T", "Alpha",
"Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville",
"Tiller", "Utility Trailer"
};

forward SpeedoUpdate();

public OnFilterScriptInit()
{
print("************************************");
print("* Crazy Speedometer - Crazy Speedo *");
print("* Version 1 *");
print("* Creator: Littlejohny *");
print("* Script by GTA-Scripting.tk *");
print("************************************");

SetTimer("SpeedoUpdate", 1000, 1);

for(new v=0; v<MAX_VEHICLES; v++)
{
SaveLastPosition(v);
}
for(new i=0; i<SLOTS; i++)
{
box[i] = TextDrawCreate(198.000000,396.000000,"_");
TextDrawUseBox(box[i],1);
TextDrawBoxColor(box[i],0x00000066);
TextDrawTextSize(box[i],430.000000,0.000000);
TextDrawAlignment(box[i],0);
TextDrawBackgroundColor(box[i],0x00000033);
TextDrawFont(box[i],3);
TextDrawLetterSize(box[i],1.000000,3.000000);
TextDrawColor(box[i],0xffffffff);
TextDrawSetOutline(box[i],1);
TextDrawSetProportional(box[i],1);
TextDrawSetShadow(box[i],1);

tacho[i] = TextDrawCreate(270.000000,377.000000,"Velocidade") ;
TextDrawUseBox(tacho[i],1);
TextDrawBoxColor(tacho[i],0x00000066);
TextDrawTextSize(tacho[i],373.000000,73.000000);
TextDrawAlignment(tacho[i],0);
TextDrawBackgroundColor(tacho[i],0x000000ff);
TextDrawFont(tacho[i],2);
TextDrawLetterSize(tacho[i],0.399999,1.400000);
TextDrawColor(tacho[i],0xffffffff);
TextDrawSetOutline(tacho[i],1);
TextDrawSetProportional(tacho[i],1);
TextDrawSetShadow(tacho[i],1);

fahrzeug[i] = TextDrawCreate(198.000000,396.000000," ");
TextDrawAlignment(fahrzeug[i],0);
TextDrawBackgroundColor(fahrzeug[i],0x000000ff);
TextDrawFont(fahrzeug[i],1);
TextDrawLetterSize(fahrzeug[i],0.299999,1.000000);
TextDrawColor(fahrzeug[i],0xffffffff);
TextDrawSetOutline(fahrzeug[i],1);
TextDrawSetProportional(fahrzeug[i],1);
TextDrawSetShadow(fahrzeug[i],1);

mph[i] = TextDrawCreate(345.000000,396.000000," ");
TextDrawAlignment(mph[i],0);
TextDrawBackgroundColor(mph[i],0x000000ff);
TextDrawFont(mph[i],1);
TextDrawLetterSize(mph[i],0.299999,1.000000);
TextDrawColor(mph[i],0xffffffff);
TextDrawSetOutline(mph[i],1);
TextDrawSetProportional(mph[i],1);
TextDrawSetShadow(mph[i],1);

hoehe[i] = TextDrawCreate(199.000000,408.000000," ");
TextDrawAlignment(hoehe[i],0);
TextDrawBackgroundColor(hoehe[i],0x000000ff);
TextDrawFont(hoehe[i],1);
TextDrawLetterSize(hoehe[i],0.299999,1.000000);
TextDrawColor(hoehe[i],0xffffffff);
TextDrawSetOutline(hoehe[i],1);
TextDrawSetProportional(hoehe[i],1);
TextDrawSetShadow(hoehe[i],1);

zustand[i] = TextDrawCreate(345.000000,408.000000," ");
TextDrawAlignment(zustand[i],0);
TextDrawBackgroundColor(zustand[i],0x000000ff);
TextDrawFont(zustand[i],1);
TextDrawLetterSize(zustand[i],0.299999,1.000000);
TextDrawColor(zustand[i],0xffffffff);
TextDrawSetOutline(zustand[i],1);
TextDrawSetProportional(zustand[i],1);
TextDrawSetShadow(zustand[i],1);

url[i] = TextDrawCreate(180.000000,425.000000,"URL");
TextDrawAlignment(url[i],0);
TextDrawBackgroundColor(url[i],0x000000ff);
TextDrawFont(url[i],1);
TextDrawLetterSize(url[i],0.40,1.700000);
TextDrawColor(url[i],0xffffffff);
TextDrawSetOutline(url[i],1);
TextDrawSetProportional(url[i],1);
TextDrawSetShadow(url[i],1);
}
return 1;
}

public OnFilterScriptExit()
{
return 1;
}

public SpeedoUpdate()
{
new Float:Speedo_X,Float:Speedo_Y,Float:Speedo_Z;
new Float:PlayerSpeedDistance,value;
new Float:Speedo_HP;

for(new i=0; i<SLOTS; i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
{
GetPlayerPos(i, Speedo_X, Speedo_Y, Speedo_Z);
GetPlayerVehicleID(i);
GetVehicleHealth(GetPlayerVehicleID(i), Speedo_HP);
PlayerSpeedDistance = floatsqroot(floatpower(floatabs(floatsub(Speedo_X, SavePlayerPos[i][sX])),2)+floatpower(floatabs(floatsub(Speedo_Y,SavePl ayerPos[i][sY])),2)+floatpower(floatabs(floatsub(Speedo_Z,SavePl ayerPos[i][sZ])),2));
value = floatround(PlayerSpeedDistance * 5000);

new str1[256],str2[256],str3[256],str4[256];
if(SpeedoON[i] == 0)
{
TextDrawShowForPlayer(i, box[i]); TextDrawShowForPlayer(i, tacho[i]); TextDrawShowForPlayer(i, fahrzeug[i]); TextDrawShowForPlayer(i, mph[i]);
TextDrawShowForPlayer(i, hoehe[i]); TextDrawShowForPlayer(i, zustand[i]); TextDrawShowForPlayer(i, url[i]);
SpeedoON[i] = 1;
}
new mph_anzahl = floatround(value/1000);

format(str1,sizeof(str1),"Veiculo: ~y~%s",VehicleNames[GetVehicleModel(GetPlayerVehicleID(i))-400]);
TextDrawSetString(fahrzeug[i], str1);

if(mph_anzahl >= 200)
{
format(str2,sizeof(str2),"KM/H: ~r~%d",mph_anzahl);
TextDrawSetString(mph[i], str2);
}
else if(mph_anzahl >= 150)
{
format(str2,sizeof(str2),"KM/H: ~y~%d",mph_anzahl);
TextDrawSetString(mph[i], str2);
}
else if(mph_anzahl >= 100)
{
format(str2,sizeof(str2),"KM/H: ~g~%d",mph_anzahl);
TextDrawSetString(mph[i], str2);
}
else
{
format(str2,sizeof(str2),"KM/H: ~b~%d",mph_anzahl);
TextDrawSetString(mph[i], str2);
}

format(str3,sizeof(str3),"Gбs: ~g~%.1f", Speedo_Z);
TextDrawSetString(hoehe[i], str3);

if(Speedo_HP >= 551)
{
format(str4,sizeof(str4),"Vida: ~g~%.2f", Speedo_HP);
TextDrawSetString(zustand[i], str4);
}
else if(Speedo_HP >= 361)
{
format(str4,sizeof(str4),"Vida: ~y~%.2f", Speedo_HP);
TextDrawSetString(zustand[i], str4);
}
else
{
format(str4,sizeof(str4),"Vida: ~r~%.2f", Speedo_HP);
TextDrawSetString(zustand[i], str4);
}
TextDrawSetString(url[i], URL);
}
SavePlayerPos[i][sX] = Speedo_X, SavePlayerPos[i][sY] = Speedo_Y, SavePlayerPos[i][sZ] = Speedo_Z;
}
for(new i=0; i<SLOTS; i++)
{
if(!IsPlayerInAnyVehicle(i))
{
TextDrawHideForPlayer(i, box[i]); TextDrawHideForPlayer(i, tacho[i]); TextDrawHideForPlayer(i, fahrzeug[i]); TextDrawHideForPlayer(i, mph[i]);
TextDrawHideForPlayer(i, hoehe[i]); TextDrawHideForPlayer(i, zustand[i]); TextDrawHideForPlayer(i, url[i]);
SpeedoON[i] = 0;
}
}
}

public OnVehicleSpawn(vehicleid)
{
GasVeh[vehicleid] =- 1;
return 1;
}

stock GetDistanceToLastPoint(vehicleid)
{
new Float2, Float:y2, Float:z2, Floatutput;
GetVehiclePos(vehicleid, x2, y2, z2);
output = floatsqroot(floatpower(floatabs(floatsub(x2, sVehicle_X[vehicleid])), 2)+floatpower(floatabs(floatsub(y2, sVehicle_Y[vehicleid])), 2)+floatpower(floatabs(floatsub(z2, sVehicle_Z[vehicleid])), 2));
return floatround(output);
}

stock SaveLastPosition(vehicleid)
{
new Float:SaveCoord_X, Float:SaveCoord_Y, Float:SaveCoord_Z;
GetVehiclePos(vehicleid, SaveCoord_X, SaveCoord_Y, SaveCoord_Z);
sVehicle_X[vehicleid]=SaveCoord_X;
sVehicle_Y[vehicleid]=SaveCoord_Y;
sVehicle_Z[vehicleid]=SaveCoord_Z;
}

Reply
#2

Usa o search e procura um FS velocimetro
Reply
#3

Quote:
Originally Posted by Lucas Nicolas
Посмотреть сообщение
Usa o search e procura um FS velocimetro
Fs dos velocimentros atй agora so baichei bugados o carro nгo anda tudo bugado =D.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)