SA-MP Forums Archive
progress bar help? - 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: progress bar help? (/showthread.php?tid=469571)



progress bar help? - SomeRandomGuy123 - 13.10.2013

can someone please help me out and give me an example of a progress bar updating every second for 5 seconds, then destroys it self?
thanks


Re: progress bar help? - Pottus - 13.10.2013

You create a player progress bar when they connect and it will automatically destroy when they disconnect. You don't want to destroy anything rather Show/Hide. I can't find the link to the player version so here is a pastebin of the version I have currently http://pastebin.com/wajn4its not sure why it's not on the original thread (Or maybe I missed it?).

Original Thread:

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


Re: progress bar help? - SomeRandomGuy123 - 13.10.2013

no... create it when a player enters a checkpoint, waits 5 seconds while it updates until it reaches 0 then destroy it..
wouldn't it look something like this?
public onplayerentercheckpoint
{
{
ShowProgressBarForPlayer(barid, playerid);
SetProgressBarMaxValue(barid, 700);
UpdateProgessBar(barid, playerid=INVALID_PLAYER_ID);
SetTimerEx(SetTimerEx("Progbar", 5000, false, "i", playerid);
HideProgressBarForPlayer(barid, playerid);
return 1;
}
return 0;
}

just a quick example, but yes?


Re: progress bar help? - Pottus - 13.10.2013

That makes no sense did you not listen? You only need to create it once and it will automatically destroy when a player quits you only need to show/hide. Create/destroy each time is counter intuitive and makes absolutely no sense at all.

@Edit - Check the pastebin link your using the wrong include.