[Ajuda] Conflito
#1

conflito com o velocнmetro dos players

sla quem feiz mas axo que foi o Bruno pereira
pawn Код:
forward AttVelocimetro();
new Text:Fundo;
new Text:Velocidade;
new TempoVelocimetro;
new Text:Lataria;
new Text:Modelo;
new Float:LatariaCarro;
new Text:MsgVelocimetro;
pawn Код:
// === VELOCIMETRO == // FUNDO!
    Fundo = TextDrawCreate(184.000000, 283.000000, "       ");
    TextDrawBackgroundColor(Fundo, 255);
    TextDrawFont(Fundo, 1);
    TextDrawLetterSize(Fundo, 0.509999, 1.000000);
    TextDrawColor(Fundo, -1);
    TextDrawSetOutline(Fundo, 0);
    TextDrawSetProportional(Fundo, 1);
    TextDrawSetShadow(Fundo, 1);
    TextDrawUseBox(Fundo, 1);
    TextDrawBoxColor(Fundo, 30);
    TextDrawTextSize(Fundo, 28.000000, -17.000000);
    // === VELOCIMETRO == // MENSAGEM " VELOCIMETRO "
    MsgVelocimetro = TextDrawCreate(53.000000, 267.000000, "Velocimetro");
    TextDrawBackgroundColor(MsgVelocimetro, 255);
    TextDrawFont(MsgVelocimetro, 2);
    TextDrawLetterSize(MsgVelocimetro, 0.339999, 1.000000);
    TextDrawColor(MsgVelocimetro, -1);
    TextDrawSetOutline(MsgVelocimetro, 1);
    TextDrawSetProportional(MsgVelocimetro, 1);
    // === VELOCIMETRO == // VELOCIDADE!
    Velocidade = TextDrawCreate(48.000000, 291.000000, "Velocidade: ~y~");
    TextDrawBackgroundColor(Velocidade, 255);
    TextDrawFont(Velocidade, 3);
    TextDrawLetterSize(Velocidade, 0.319999, 1.100000);
    TextDrawColor(Velocidade, -1);
    TextDrawSetOutline(Velocidade, 1);
    TextDrawSetProportional(Velocidade, 1);
    // === VELOCIMETRO == // MODELO CARRO!
    Modelo = TextDrawCreate(48.000000, 306.000000, "Modelo: ~y~");
    TextDrawBackgroundColor(Modelo, 255);
    TextDrawFont(Modelo, 3);
    TextDrawLetterSize(Modelo, 0.400000, 1.000000);
    TextDrawColor(Modelo, -1);
    TextDrawSetOutline(Modelo, 1);
    TextDrawSetProportional(Modelo, 1);
    // === VELOCIMETRO == // LATARIA!
    Lataria = TextDrawCreate(48.000000, 319.000000, "Lataria: ~y~");
    TextDrawBackgroundColor(Lataria, 255);
    TextDrawFont(Lataria, 3);
    TextDrawLetterSize(Lataria, 0.419999, 1.000000);
    TextDrawColor(Lataria, -1);
    TextDrawSetOutline(Lataria, 1);
    TextDrawSetProportional(Lataria, 1);
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)// new state= estado que o player esta agora! PLAYER_STATE_DRIVER= Motorista!
    {
        TextDrawShowForPlayer(playerid,Velocidade);
        TextDrawShowForPlayer(playerid,MsgVelocimetro);
        TextDrawShowForPlayer(playerid,Fundo);
        TextDrawShowForPlayer(playerid,Modelo);
        TextDrawShowForPlayer(playerid,Lataria);
        TempoVelocimetro = SetTimerEx("AttVelocimetro", 500, true, "i", playerid);// Settimer de atualizar o velocimetro!
    }
pawn Код:
public AttVelocimetro()
{
    foreach(Player, i)
    {
        if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
        {
            new String[256];
            TextDrawShowForPlayer(i, Fundo);
            TextDrawShowForPlayer(i, MsgVelocimetro);
            format(String, 30, "Velocidade: ~y~%d Km/h", VelocidadeKM(i));
            TextDrawShowForPlayer(i, Velocidade);
            TextDrawSetString(Velocidade, String);
            GetVehicleHealth(GetPlayerVehicleID(i), LatariaCarro);
            format(String, 40,"Lataria: ~y~%0.0f%%", LatariaCarro);
            TextDrawShowForPlayer(i,Lataria);
            TextDrawSetString(Lataria, String);
            format(String, 30,"Modelo: ~y~%s", Modelos[GetVehicleModel(GetPlayerVehicleID(i))-400]);
            TextDrawShowForPlayer(i, Modelo);
            TextDrawSetString(Modelo, String);
        }
        else
        {
            TextDrawHideForPlayer(i, Fundo);
            TextDrawHideForPlayer(i, Velocidade);
            TextDrawHideForPlayer(i, MsgVelocimetro);
            TextDrawHideForPlayer(i, Lataria);
            TextDrawHideForPlayer(i, Modelo);

        }
    }
    return 1;
}




bom akie esta todo cod, o conflito e que eu to la no carro ta normal, dai vai la entra outro em outro carro comeзa a buga o nome, a velocidade desde ja vlws hehe
Reply
#2

mlz double maiss alguein?
Reply
#3

Claro neh, quando o TextDraw й para vбrios players com valores diferentes usa-se assim:

pawn Код:
new Tal[MAX_PLAYERS];
Tal[playerid] = TextDrawCreate(..);
//...E assim por diante!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)