27.02.2014, 13:44
Oi, criei um simples mega basico sistema de velocimetro sу pra pegar a velocidade do carro mesmo, mas estб dando um erro. Quando eu entro no carro aparece a textdraw sу que quando eu aperto W(pra andar) no veiculo, somente um nъmero '1' й setado na textdraw, mas nгo atualiza para outros numeros de velocidade mesmo eu fazendo um timer.. Oquк pode ser?
pawn Код:
//Velocimetro:
new Text:TxdVelo;
forward AtualizarVelo(playerid);
//Textdraw Velocimetro
TxdVelo = TextDrawCreate(538.000000, 342.000000, "~W~H ~G~~H~KM/H");
TextDrawBackgroundColor(TxdVelo, 255);
TextDrawFont(TxdVelo, 1);
TextDrawLetterSize(TxdVelo, 0.480000, 1.799999);
TextDrawColor(TxdVelo, -1);
TextDrawSetOutline(TxdVelo, 1);
TextDrawSetProportional(TxdVelo, 1);
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
SetTimer("AtualizarVelo",1000,1);
return 1;
}
//public
public AtualizarVelo(playerid)
{
//Informaзхes Player - Velocimetro
new txtVelocimetro[60], Float:Velocity[3];
format(txtVelocimetro, sizeof(txtVelocimetro), "~W~%d ~G~~H~KM/H", GetVehicleVelocity(GetPlayerVehicleID(playerid), Velocity[0], Velocity[1], Velocity[2]));
TextDrawSetString(TxdVelo, txtVelocimetro);
TextDrawShowForPlayer(playerid, TxdVelo);
return 1;
}