Progress Bar [HELP] [+REP]
#1

How do I create a progress bar for a player score bar? I will deal with the color. I want is , that this progress bar to be just below the screen. The Max Score is 10000. (Accomplished Player). So, if the player is new, it will show 0/10000 (Empty Bar), and the bar to update instantly when a player receives score. So, slowly the bar will fill up to show him how much he was to work hard to achieve. How do I do that? If its hard to give me the coordinates, its ok. I'll find it myself. I also have to add the text just above the bar saying "Score Progress /10000" because If I don't, the player might get confused wondering what that bar is... Please help me. No matter who does, every single person gets a Reputation.
Reply
#2

Use this, is one of most useful includes + ingame progress bar creator:

https://sampforum.blast.hk/showthread.php?tid=113443
Reply
#3

It doesn't work for me, that's why I posted this. I always search before posting for HELP.
Reply
#4

Anyone?
Reply
#5

why you not use a couple of text draw box with different colors for stage of progress ?

edit : Like this
Reply
#6

follow the example
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 ;
}

//when you gain experience
Value[playerid] ++;


forward UpdateBar(playerid);
public UpdateBar(playerid) {
    SetProgressBarValue(barid[playerid], Value[playerid]) ;
    UpdateProgressBar(barid[playerid], playerid);
    return true;
}
is now with you.
Reply
#7

Alright thanks guys.
Reply
#8

Код:
Value[playerid] ++;
Where do I put this?
Reply
#9

Quote:
Originally Posted by RTR12
Посмотреть сообщение
Код:
Value[playerid] ++;
Where do I put this?
There

Quote:
Originally Posted by RTR12
Посмотреть сообщение
... when a player receives score ...
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)