[Help] Progress Bar
#1

Ok, first of all, good evening. I've looked here and ****** how to make a progress bar. I found many results but nothing seems to work. I also created a progress bar with Toribio's progress bar creator and include but I dunno how to make it work. I even tried editing a speedometer. What I want is a progress bar that will fill to 100% in an hour. So it will rise 1% every minute until minute 59, then it will start over. Anyone knows how to do this? plz.
Reply
#2

Try this:
pawn Код:
new Bar: bar1, gMinute;

// OnGameModeInit
bar1 = CreateProgressBar(50.0, 300.0, _, _, 0xFF0000FF, 60);
SetTimer("UpdateBar", 60000, true); // Each minute

//
forward UpdateBar();
public UpdateBar()
{
    gMinute ++;

    if(gMinute > 59) // We reach to minute 59
    {
        gMinute = 0;

        SetProgressBarValue(bar1, gMinute);
        ShowProgressBarForAll(bar1);
    }
    else
    {
        SetProgressBarValue(bar1, gMinute);
        ShowProgressBarForAll(bar1);
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by -Prodigy-
Посмотреть сообщение
Try this:
pawn Код:
new Bar: bar1, gMinute;

// OnGameModeInit
bar1 = CreateProgressBar(50.0, 300.0, _, _, 0xFF0000FF, 60);
SetTimer("UpdateBar", 60000, true); // Each minute

//
forward UpdateBar();
public UpdateBar()
{
    gMinute ++;

    if(gMinute > 59) // We reach to minute 59
    {
        gMinute = 0;

        SetProgressBarValue(bar1, gMinute);
        ShowProgressBarForAll(bar1);
    }
    else
    {
        SetProgressBarValue(bar1, gMinute);
        ShowProgressBarForAll(bar1);
    }
    return 1;
}
Ok I'll try it now. Thanks for helping.
Reply
#4

I can't see the man. I even used my own bar and doesn't work. why?

My bar
pawn Код:
CreateProgressBar(524.00, 222.00, 55.50, 3.20, 1667458047, 60);
Edit: Ok I did it! I moved
pawn Код:
ShowProgressBarForAll(bar1);
To OnPlayerSpawn

Thank you so much for the help dude I really appreciate it! thanks! I'll +rep you but it wont have any effect because mine is 0 lol.
Reply
#5

Try putting:
pawn Код:
ShowProgressBarForPlayer(playerid, bar1);
In OnPlayerConnect
Reply
#6

Quote:
Originally Posted by -Prodigy-
Посмотреть сообщение
Try putting:
pawn Код:
ShowProgressBarForPlayer(playerid, bar1);
In OnPlayerConnect
Yeah I did that look at my previous post, I was editing it when you posted this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)