SA-MP Forums Archive
[Help] Progress Bar - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Help] Progress Bar (/showthread.php?tid=473651)



[Help] Progress Bar - iDuckling - 03.11.2013

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.


Re: [Help] Progress Bar - -Prodigy- - 03.11.2013

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;
}



Re: [Help] Progress Bar - iDuckling - 03.11.2013

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.


Re: [Help] Progress Bar - iDuckling - 03.11.2013

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.


Re: [Help] Progress Bar - -Prodigy- - 03.11.2013

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


Re: [Help] Progress Bar - iDuckling - 03.11.2013

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