How to make a progress bar ? [READ] [+Rep]
#1

need to know how to make a loading bar with a 5 second timer e.g

player enters checkpoint and on doing so a loading bar comes up and fills up whilst counting to 5 when its full

i need something like this:



ive already finished the checkpoint:

PHP код:
public restock(playerid)
{
    
SendClientMessage(playerid,COLOR_YELLOW,"* You have refilled your stock.");
    
finished[playerid]=0;
    
truckstart(playerid);

PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
// other code
    
else
    {
        
rstock[playerid] = SetTimerEx("restock"5000false"i"playerid);
    }
}
     return 
1;

please no one word answers or stupid remarks, they dont help anyone. Will give rep to good answers or code given.


thanks guys
Reply
#2

you will need a textdraw go to ****** and search for "Textdraw maker sa:mp"
Reply
#3

Why not use the progress bar include? I'm not sure who it is by. Also when using your [ PHP ] codes please use [ PAWN ] or [ pawn ]. Thanks
Reply
#4

Quote:
Originally Posted by xMichaelx
Посмотреть сообщение
Why not use the progress bar include? I'm not sure who it is by. Also when using your [ PHP ] codes please use [ PAWN ] or [ pawn ]. Thanks
already used ******, dont want an include it can be done without one plus it was released 3 years ago. well outdated.

also i no it's a text draw, can an older member please give me a more specific answer....

example code etc.
Reply
#5

never mind i found a really good tutorial from a friend on msn,

a perfect answer to this thread for the noobs who post shit on this forum would of been:

" ive found this tutorial for you, here you go. Hope it helps
https://sampforum.blast.hk/showthread.php?tid=2867 "

see how helpful that would of been


/end thread.
Reply
#6

Well, it requires some math work. First of all you will need two textdraws; one dark one for the background and one lighter colored on for the foreground. This can be done easily in any textdraw editor.

When that's done, you need to find the actual width of the background textdraw and equal that width to 100% so you can reference to it when you need to set the foreground textdraw. If I'm not mistaken (and I rarely am) the x value of TextDrawTextSize controls the width of the textdraw box, TextDrawLetterSize controls its height.

If, for example, the x value for TextDrawTextSize in the background is 300, you should equal that 300 to 100%; the bar is completely filled. Now, if you want to set the x value (width) of the foreground textdraw to say, 37%, you should take 37% of that 300 and set that as the new width, which would then become: 300 * (37/100) = 111.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)