[Ajuda] Velocimetro bugado
#1

O velocimetro fica mostrando a velocidade assim -18949779 KM/H O.O

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;
}
Reply


Messages In This Thread
Velocimetro bugado - by Quazar - 11.08.2012, 15:20
Re: Velocimetro bugado - by Delay - 11.08.2012, 16:08
Re: Velocimetro bugado - by Quazar - 11.08.2012, 16:11
Re: Velocimetro bugado - by Prompt - 11.08.2012, 23:22
Re: Velocimetro bugado - by Quazar - 12.08.2012, 07:34
Re: Velocimetro bugado - by paulor - 12.08.2012, 13:56
Re: Velocimetro bugado - by Quazar - 12.08.2012, 14:17
Re: Velocimetro bugado - by paulor - 12.08.2012, 15:42
Re: Velocimetro bugado - by Quazar - 12.08.2012, 16:19
Re: Velocimetro bugado - by paulor - 12.08.2012, 20:55

Forum Jump:


Users browsing this thread: 1 Guest(s)