[Ajuda] Velocimetro
#5

Quote:
Originally Posted by PT
Посмотреть сообщение
pawn Код:
public OnPlayerConnect(playerid)
{
    TextoVelocimetro[playerid] = CreatePlayerTextDraw(playerid,200.0, 433.0, "_");
    return 1;
}


public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_DRIVER)
    {
        KillTimer(Velo[playerid]);
        PlayerTextDrawHide(playerid,TextoVelocimetro[playerid]);
    }
    if(newstate == PLAYER_STATE_DRIVER)
    {
        Velo[playerid] = SetTimer("TimeVelocimetro", 100, true);//time que vai atualizar o velocimetro
    }
    return 1;
}

public TimeVelocimetro(playerid)
{
    new str[50];
    format(str, sizeof(str), "Velocidade: %i", VelocidadeDoVeiculo(playerid));
    PlayerTextDrawSetString(playerid, TextoVelocimetro[playerid], str);
    PlayerTextDrawShow(playerid, TextoVelocimetro[playerid]);
    return 1;
}
a pouco me enganei, tem de 1є matar o timer so depois esconder a textdraw
kk correto! Nгo tinha me ligado nisso, desculpa a vergonha kkk Deu certinho agora!
Reply


Messages In This Thread
Velocimetro - by StrondaXxT - 04.02.2015, 12:50
Re: Velocimetro - by PT - 04.02.2015, 13:01
Re: Velocimetro - by StrondaXxT - 04.02.2015, 13:27
Re: Velocimetro - by PT - 04.02.2015, 13:30
Re: Velocimetro - by StrondaXxT - 04.02.2015, 13:40

Forum Jump:


Users browsing this thread: 1 Guest(s)