Experience bar
#5

Quote:
Originally Posted by jorambo
Посмотреть сообщение
Oke it is a start now I have this:
pawn Код:
new Bar:vhealth[MAX_PLAYERS];
new Float:ExpBar;
new Float:AgeBar;
forward ProgressBar();
public ProgressBar() //I prefer not to use OnPlayerUpdate with textdraws
{
    for(new playerid; playerid < MAX_PLAYERS; playerid++) //I recommend foreach(Player, playerid)
    {
        ExpBar = PlayerInfo[playerid][pExp];
        AgeBar = PlayerInfo[playerid][pAge];
        SetProgressBarValue(vhealth[playerid], ExpBar);
        UpdateProgressBar(vhealth[playerid], playerid);
        SetProgressBarMaxValue(vhealth[playerid],AgeBar);
    }
}
And under ongamemodeinit:
pawn Код:
SetTimer("ProgressBar",500,true);//every 5 minutes
And under onplayerconnect:
pawn Код:
vhealth[playerid] = CreateProgressBar(548.5, 36.0, _, _, 0x00FF00FF, PlayerInfo[playerid][pAge]);
ShowProgressBarForPlayer(playerid, vhealth[playerid]);
The progress bar is being displayed.

But when I use /setstat and I set for example my age to 10 and exp to 2 it doesn't fill up.

What do I do wrong?
Everytime you use SetProgressBarValue you have to update it before it works.
Reply


Messages In This Thread
Experience bar - by jorambo - 01.07.2011, 13:31
Re: Experience bar - by The Woody - 01.07.2011, 14:28
Re: Experience bar - by jorambo - 01.07.2011, 16:54
Re: Experience bar - by jorambo - 03.07.2011, 09:37
Re: Experience bar - by The Woody - 03.07.2011, 23:21
Re: Experience bar - by Unte99 - 17.07.2011, 12:44

Forum Jump:


Users browsing this thread: 1 Guest(s)