[Ajuda] Velocimetro com erro - 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)
+---- Thread: [Ajuda] Velocimetro com erro (
/showthread.php?tid=465682)
Velocimetro com erro -
matanza87 - 23.09.2013
eu estava colocando o estado da lataria do veiculo usei o getvehiclehealth mais ai apareceu um numero enorme no estado tipo esse:1147815859 eu achei que a saude do veiculo ia sу ate 1000...eu comecei a tentar fazer meu velocimetro ontem e to meio perdido queria saber porque a saude do veiculo estб passando de 1000.
pawn Код:
new String[5],Sstring[10],Float:health,vehicleid = GetPlayerVehicleID(playerid),estado[10];
GetVehicleHealth(vehicleid, health);
if(GetVehicleHealth(vehicleid,health) > 1147815859 )
{
estado = "otimo";
}
if(GetVehicleHealth(vehicleid,health) > 1146935357 && GetVehicleHealth(vehicleid,health) < 1147815859)
{
estado = "bom";
}
if(GetVehicleHealth(vehicleid,health) > 1144396120 && GetVehicleHealth(vehicleid,health) < 1146935357)
{
estado= "razoavel";
}
if(GetVehicleHealth(vehicleid,health) > 1142107644 && GetVehicleHealth(vehicleid,health) < 1144396120)
{
estado= "ruim";
}
if(GetVehicleHealth(vehicleid,health) < 1136365860)
{
estado= "pessimo";
}
format(String, sizeof(String), "%d",GetPlayerSpeed(playerid));//velocidade
TextDrawSetString(Text:Textdraw71, String);
format(Sstring, sizeof(Sstring), "%s",estado);//estado
TextDrawSetString(Text:Textdraw74, Sstring);
Agradeзo a todos que tentarem me responder.
Re: Velocimetro com erro -
PT - 23.09.2013
pawn Код:
new String[5],Sstring[10],Float:health,vehicleid = GetPlayerVehicleID(playerid),estado[10];
GetVehicleHealth(vehicleid, health);
if(GetVehicleHealth(vehicleid,health) > 900 )
{
estado = "otimo";
}
if(GetVehicleHealth(vehicleid,health) > 800 && GetVehicleHealth(vehicleid,health) < 899)
{
estado = "bom";
}
if(GetVehicleHealth(vehicleid,health) > 700 && GetVehicleHealth(vehicleid,health) < 799)
{
estado= "razoavel";
}
if(GetVehicleHealth(vehicleid,health) > 500 && GetVehicleHealth(vehicleid,health) < 699)
{
estado= "ruim";
}
if(GetVehicleHealth(vehicleid,health) < 250)
{
estado= "pessimo";
}
format(String, sizeof(String), "%d",GetPlayerSpeed(playerid));//velocidade
TextDrawSetString(Text:Textdraw71, String);
format(Sstring, sizeof(Sstring), "%f",estado);//estado
TextDrawSetString(Text:Textdraw74, Sstring);
tenta