Progress Bar [HELP] [+REP]
#10

I would not use a timer here...
you could update the progress when you Value[playerid] ++;

why update it every 5000ms when you can update it only when needed.

something like

pawn Код:
new Bar:barid[MAX_PLAYERS];
new Value[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    barid[playerid] = //CreateProgressBar ( .. ) ;
    ShowProgressBarForPlayer(playerid, barid[playerid]) ;
    SetProgressBarValue(barid[playerid], Value[playerid]) ;
    SetProgressBarMaxValue(barid[playerid], 10000);
    //SetTimerEx("UpdateBar", 5000, true, "i", playerid) ;
    return true ;
}



forward UpdateBar(playerid);
public UpdateBar(playerid)
{
    SetProgressBarValue(barid[playerid], Value[playerid]) ;
    UpdateProgressBar(barid[playerid], playerid);
    return true;
}



//when you gain experience
Value[playerid] ++;
UpdateBar(playerid);
Reply


Messages In This Thread
Progress Bar [HELP] [+REP] - by Sting. - 24.04.2012, 13:27
Re: Progress Bar [HELP] [+REP] - by Sasino97 - 24.04.2012, 14:41
Re: Progress Bar [HELP] [+REP] - by Sting. - 24.04.2012, 15:26
Re: Progress Bar [HELP] [+REP] - by Sting. - 25.04.2012, 03:12
Re: Progress Bar [HELP] [+REP] - by Azazelo - 25.04.2012, 03:17
Re: Progress Bar [HELP] [+REP] - by zbt - 25.04.2012, 03:40
Re: Progress Bar [HELP] [+REP] - by Sting. - 25.04.2012, 06:07
Re: Progress Bar [HELP] [+REP] - by Sting. - 25.04.2012, 15:37
Re: Progress Bar [HELP] [+REP] - by MadeMan - 25.04.2012, 17:05
Re: Progress Bar [HELP] [+REP] - by Jonny5 - 25.04.2012, 17:17

Forum Jump:


Users browsing this thread: 5 Guest(s)