01.07.2011, 16:54
Oke it is a start now I have this:
And under ongamemodeinit:
And under onplayerconnect:
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?
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);
}
}
pawn Код:
SetTimer("ProgressBar",500,true);//every 5 minutes
pawn Код:
vhealth[playerid] = CreateProgressBar(548.5, 36.0, _, _, 0x00FF00FF, PlayerInfo[playerid][pAge]);
ShowProgressBarForPlayer(playerid, vhealth[playerid]);
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?