13.07.2011, 23:16
Tenta:
Nunca mexi com a include ProgressBar, portanto deve ter alguns erros.
pawn Код:
forward AtualizarVelocidade(playerid);
new Bar:Velocidade[MAX_PLAYERS];
new AtualizarVelocidadeTimer[MAX_PLAYERS];
public OnGameModeInit()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
Velocidade[i] = CreateProgressBar(142.00, 437.00, 55.50, 3.20, -1, 100.0);
}
return 1;
}
public OnPlayerStateChange(playerid, oldstate, newstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
AtualizarVelocidadeTimer[playerid] = SetTimerEx("AtualizarVelocidade", 1000, 1, "i", playerid);
ShowProgressBar(Velocidade[playerid]); //se esse for o nome da funзгo que faz a progressbar ser mostrada
return 1;
}
else if(newstate == PLAYER_STATE_ONFOOT)
{
HideProgressBar(Velocidade[playerid], playerid); //se esse for o nome da funзгo que faz a progressbar parar de ser mostrada
KillTimer(AtualizarVelocidadeTimer[playerid]);
return 1;
}
return 1;
}
public AtualizarVelocidade(playerid)
{
new Float:X, Float:Y, Float:Z;
GetVehicleVelocity(GetPlayerVehicleID(playerid), X, Y, Z);
SetProgressBarValue(Velocidade[playerid], X);
UpdateProgressBar(Velocidade[playerid], playerid);
}