[Ajuda] Erro no velocimetro
#1

Olб, eu fiz um codigo para velocimetro, mas quando entra no carro aparece 2 Velocimetros um por cima do outro, alguem pode me ajudar?

Codigo:
pawn Код:
forward DashBoard();
public DashBoard()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
        new aname[MAX_PLAYER_NAME];
        GetPlayerName(i, aname, MAX_PLAYER_NAME);
        format(file, sizeof(file), PASTA_CONTAS, aname);
        if(dini_Int(file, "Velocimetro") == 1){
                new String[128];
                new Float:X, Float:Y, Float:Z, Float:Speed;
                GetVehicleVelocity(GetPlayerVehicleID(i), X, Y, Z);
                Speed = floatmul(floatmul(floatsqroot(floatadd(floatadd(floatpower(X, 2), floatpower(Y, 2)),  floatpower(Z, 2))), 100.0), 1.5);
                VHS[i] = TextDrawCreate(11.000000,291.000000,"");
                TextDrawFont(VHS[i],3);
                TextDrawBackgroundColor(VHS[i], 0x000000FF);
                TextDrawLetterSize(VHS[i],0.400000,1.300000);
                TextDrawColor(VHS[i], -1);
                TextDrawSetOutline(VHS[i], 1);
                TextDrawShowForPlayer(i, VHS[i]);
        if(IsPlayerInAnyVehicle(i))
        {
            format(String,sizeof(String),"Velocimetro: %i ~y~~h~KM/h", floatround(Speed, floatround_floor));
            TextDrawSetString(VHS[i], String);
            TextDrawShowForPlayer(i,VHS[i]);
        }
        else
        {
            TextDrawHideForPlayer(i,VHS[i]);
        }
    }
  }
}
return 1;
}
Reply
#2

pawn Код:
forward DashBoard();
public DashBoard()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
        new aname[MAX_PLAYER_NAME];
        GetPlayerName(i, aname, MAX_PLAYER_NAME);
        format(file, sizeof(file), PASTA_CONTAS, aname);
        if(dini_Int(file, "Velocimetro") == 1){
                new String[128];
                new Float:X, Float:Y, Float:Z, Float:Speed;
                GetVehicleVelocity(GetPlayerVehicleID(i), X, Y, Z);
                Speed = floatmul(floatmul(floatsqroot(floatadd(floatadd(floatpower(X, 2), floatpower(Y, 2)),  floatpower(Z, 2))), 100.0), 1.5);
                VHS[i] = TextDrawCreate(11.000000,291.000000,"");
                TextDrawFont(VHS[i],3);
                TextDrawBackgroundColor(VHS[i], 0x000000FF);
                TextDrawLetterSize(VHS[i],0.400000,1.300000);
                TextDrawColor(VHS[i], -1);
                TextDrawSetOutline(VHS[i], 1);
        if(IsPlayerInAnyVehicle(i))
        {
            format(String,sizeof(String),"Velocimetro: %i ~y~~h~KM/h", floatround(Speed, floatround_floor));
            TextDrawSetString(VHS[i], String);
            TextDrawShowForPlayer(i,VHS[i]);
        }
        else
        {
            TextDrawHideForPlayer(i,VHS[i]);
        }
    }
  }
}
return 1;
}
Reply
#3

Oh God, agora que vi que tinha 2 TextDrawShowForPlayer kkkkkkkkkkkkkkkkk Desculpa o incomodo galera u-u

@Edit

Mudei pra esse jeito, mas nгo deu, continua aparecendo 2:
pawn Код:
forward DashBoard();
public DashBoard()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
        new aname[MAX_PLAYER_NAME];
        GetPlayerName(i, aname, MAX_PLAYER_NAME);
        format(file, sizeof(file), PASTA_CONTAS, aname);
        if(dini_Int(file, "Velocimetro") == 1){
        if(IsPlayerInAnyVehicle(i))
        {
                new String[128];
                new Float:X, Float:Y, Float:Z, Float:Speed;
                GetVehicleVelocity(GetPlayerVehicleID(i), X, Y, Z);
                Speed = floatmul(floatmul(floatsqroot(floatadd(floatadd(floatpower(X, 2), floatpower(Y, 2)),  floatpower(Z, 2))), 100.0), 1.5);
                VHS[i] = TextDrawCreate(11.000000,291.000000,"");
                TextDrawFont(VHS[i],3);
                TextDrawBackgroundColor(VHS[i], 0x000000FF);
                TextDrawLetterSize(VHS[i],0.400000,1.300000);
                TextDrawColor(VHS[i], -1);
                TextDrawSetOutline(VHS[i], 1);
                format(String,sizeof(String),"Velocimetro: %i ~y~~h~KM/h", floatround(Speed, floatround_floor));
                TextDrawSetString(VHS[i], String);
                TextDrawShowForPlayer(i,VHS[i]);
        }
        else
        {
            TextDrawHideForPlayer(i,VHS[i]);
        }
    }
  }
}
return 1;
}
Reply
#4

Desculpa o Double, mas alguem ajuda? .-. Nгo to conseguindo arrumar
Reply
#5

poste o Text draw do velocimetro ae manow
Reply
#6

O textdraw jб ta no codigo que postei e_e
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)