04.02.2015, 13:01
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_DRIVER)
{
PlayerTextDrawHide(playerid,TextoVelocimetro[playerid]);
KillTimer(Velo[playerid]);
}
if(newstate == PLAYER_STATE_DRIVER)
{
TextoVelocimetro[playerid] = CreatePlayerTextDraw(playerid,200.0, 433.0, "_");
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;
}
Se tu tem um timer tem de o "matar" ou ele continuara ativo.

