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.