[PORQUE?]OnPlayerUpdate
#1

Bom Gente estou criando um velocimetro que esta ficando show de bola que provavelmente amanha irei posta-lo aqui.
mas estava todo faceiro tstando ele derrepente ele simplesmente sumiu o textdraw que mostra a velocidade eu estou fazendo ele para dar o "update" pelo OnPlayerUpdate onde a velocidade fica exelence nгo mente nгo da lag ou seja mostra a velocidade real de cada carro mas nгo sei a hora que ele puxa umas 10 mil vezes o OnPlayerUpdate ele some o textdraw de mostrar a velocidade eu nгo queria usar SetTimer's porque nгo sao tao ageis e demoram um pouco da a velocidade real e ai pessoal alguma ideia do que fazer

ele some so aquele Textdraw onde ta escrito

Velocidade 142KM/h

O quadro branco e a borda preta fica normal so as letras somem

Uma preview do velocimetro



@EDIT
Esqueci de postar o meu OnPlayerUpdate

em OnPlayerUpdate
pawn Код:
public OnPlayerUpdate(playerid)
{
    ChecarVelocimetro();
    return 1;
}
e a public do velocimetro й

pawn Код:
public ChecarVelocimetro()
{   for(new i=0; i<MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
    {
    new Float:xa[3];
    new string[128];
    GetPlayerPos(i, xa[0], xa[1], xa[2]);
    if(IsPlayerInRangeOfPoint(i, 100, xa[0], xa[1], xa[2]) && IsPlayerInAnyVehicle(i) && GetPlayerState(i) == PLAYER_STATE_DRIVER)
    {
    TextDrawHideForPlayer(i,Textdraw2);
    format(string, sizeof(string), "~g~Velocidade ~r~%dKM/h", VelocidadeKM(i));
    Textdraw2 = TextDrawCreate(496.000000,355.000000,string);
    TextDrawAlignment(Textdraw2,0);
    TextDrawBackgroundColor(Textdraw2,0x000000ff);
    TextDrawFont(Textdraw2,1);
    TextDrawLetterSize(Textdraw2,0.299999,1.200000);
    TextDrawColor(Textdraw2,0xffffffff);
    TextDrawSetOutline(Textdraw2,1);
    TextDrawSetProportional(Textdraw2,1);
    TextDrawSetShadow(Textdraw2,1);
    TextDrawShowForPlayer(i,Textdraw2);
    }
    }
    }
    }
    return 1;
}
Claro que o que esta na print nгo й a versгo final ai so esta a velocidade mas eu ainda vou colocar para mostrar o nome do veiculo, danos, combustivel e nome do piloto se tudo der certo se deus quiser amanha posto ele
Reply


Messages In This Thread
[PORQUE?]OnPlayerUpdate - by TiagoPS - 16.08.2010, 19:16
Re: [PORQUE?]OnPlayerUpdate - by MrDeath537 - 16.08.2010, 19:27
Re: [PORQUE?]OnPlayerUpdate - by TiagoPS - 16.08.2010, 19:32
Re: [PORQUE?]OnPlayerUpdate - by MrDeath537 - 16.08.2010, 19:40
Re: [PORQUE?]OnPlayerUpdate - by TiagoPS - 16.08.2010, 19:53
Re: [PORQUE?]OnPlayerUpdate - by Kasura - 16.08.2010, 21:52
Re: [PORQUE?]OnPlayerUpdate - by LeLeTe - 16.08.2010, 22:00
Re: [PORQUE?]OnPlayerUpdate - by [VTLS]Victor - 16.08.2010, 22:26
Re: [PORQUE?]OnPlayerUpdate - by LeLeTe - 16.08.2010, 22:30
Re: [PORQUE?]OnPlayerUpdate - by Kasura - 16.08.2010, 23:12

Forum Jump:


Users browsing this thread: 1 Guest(s)