11.08.2012, 15:20
O velocimetro fica mostrando a velocidade assim -18949779 KM/H O.O
O certo seria a velocidade.. tipo. 100 KM/H .-.
O certo seria a velocidade.. tipo. 100 KM/H .-.
pawn Код:
public OnPlayerUpdate(playerid)
{
if(IsPlayerInAnyVehicle(playerid))
{
new string[50], carid = GetPlayerVehicleID(playerid);
GetVehicleVelocity(carid, velokm[0], velokm[1], velokm[2]);
TextDrawShowForPlayer(playerid, Textdraw4);
TextDrawShowForPlayer(playerid, Textdraw6);
format(string, sizeof(string), "~p~Gasolina: ~w~%i", gss[playerid]);
TextDrawSetString(Textdraw4, string);
new Float: Velocity[3];
GetVehicleVelocity(GetPlayerVehicleID(playerid), Velocity[0], Velocity[1], Velocity[2]);
format(string, sizeof(string), "~p~Velocidade: ~w~%d KM/H", Velocity[0], Velocity[1], Velocity[2]);
TextDrawSetString(Textdraw6, string);
if(floatround(((floatsqroot(((velokm[0] * velokm[0]) + (velokm[1] * velokm[1]) + (velokm[2] * velokm[2]))) * (170.0))) * 1) > 5)
{
if(gss[playerid] == 0 && Avisado[playerid] == false)
{
SendClientMessage(playerid, COR_ERRO, "- Sua gasolina acabou, vocк pode chamar um Frentista, Guicho ou ir atй o posto mais prуximo e abastecer.");
TogglePlayerControllable(playerid, false);
Avisado[playerid] = true;
}
if(gss[playerid] > 0)
{
Retirada[playerid] += 1;
if(Retirada[playerid] >= (RETIRAR_KM*13))
{
gss[playerid]--;
TogglePlayerControllable(playerid, true);
Retirada[playerid] = 0;
Avisado[playerid] = false;
}
}
}
}
return 1;
}