Post: [TUTORIAL] How to add/costumize a "Progressbar"
02-20-2011, 07:15 PM #1
xQuZe-
You talkin to me?
(adsbygoogle = window.adsbygoogle || []).push({}); Pleas don't flame me if this is already posted. I used the search option and nothing came up.
I'm only trying to help you out. This Thread toke pretty long to make.



How to add a Progressbar:

Call this thread from anywhere you want.
    self thread doBar();

And put this somewhere in your .gsc
    doBar() 
{
self endon( "disconnect" );
self endon( "death" );
barProgress = 0;
useBar = createPrimaryProgressBar( 25 );
useBarText = createPrimaryProgressBarText( 25 );
foreach ( challengeRef, challengeData in level.challengeInfo )
{
barProgress++;
barPercent = ceil( ((barProgress/480)*100) );
useBarText setText( "Tekst " + barPercent + " percent");
useBar updateBar( barPercent / 100 );

wait ( 0.04 );
}
useBar destroyElem();
useBarText destroyElem();
}


So now if you start a game it will look like this:

You must login or register to view this content.
(it will go from 1 to 100)

How to costumize a Progressbar

So let's begin costumizing.
We'll start with this part.
    barProgress++;
barPercent = ceil( ((barProgress/480)*[COLOR="Red"]100[/COLOR]) );
useBarText setText( "Tekst " + barPercent + " percent");
useBar updateBar( barPercent / [COLOR="red"]100[/COLOR] );


The part marked in red is the highest number of the progressbar.
So let's change it to a random number...69.
Note: You must change both of the red marked numbers or it will fugg up.
Our code will now look like this.
    barProgress++;
barPercent = ceil( ((barProgress/[COLOR="Blue"]480[/COLOR])*[COLOR="Red"]69[/COLOR]) );
useBarText setText( "Tekst " + barPercent + " percent");
useBar updateBar( barPercent / [COLOR="red"]69[/COLOR] );

In-game it looks like this:

You must login or register to view this content.
(it will go from 1 to 69)

I wouldn't recommend changing the blue part.
Then the bar doesn't fit anymore. Just leave it.

We can also change the text above the bar.
    useBarText setText( "Tekst " + barPercent + " percent");

This can be changed to anything you like.
But don't make it to big like:OMGimsuchafuggashoeletomakealongfuggingtextandfailingatlife.
Leave + barPercent + in it. That's the counter.
Let's do a little change.
    useBarText setText( "Time till Jizz" + barPercent );

See how i removed a "+"?
We can also put the counter in the front:
    useBarText setText( barPercent + " percent left.");


You can also move the bar up and down by changing these:
    
useBar = createPrimaryProgressBar( [COLOR="red"]25[/COLOR] );
useBarText = createPrimaryProgressBarText( [COLOR="Red"]25[/COLOR] );

to
    
useBar = createPrimaryProgressBar( [COLOR="red"]100[/COLOR] );
useBarText = createPrimaryProgressBarText( [COLOR="Red"]100[/COLOR] );

Thx to Ju1cy again for that!

Got it? Okay let's move on

I want the bar to stay 3 seconds after it's done counting.
Go to this part:
            }
useBar destroyElem();
useBarText destroyElem();
}


We simply add wait 3.0; before it destroy's it
            }
[COLOR="Red"]wait 3.0;[/COLOR]
useBar destroyElem();
useBarText destroyElem();
}


We can also add a mod if it's done with counting.
            }
self thread doMod();
useBar destroyElem();
useBarText destroyElem();
}


    doMod()
{
//Your own mod codes here
}

Or Change the visions.
            }
[COLOR="Red"] self VisionSetNakedForPlayer("blacktest",.5);
wait 2.0;
self VisionSetNakedForPlayer(getDvar( "mapname" ), 1); [/COLOR]
useBar destroyElem();
useBarText destroyElem();
}




So that's basicly it.
I hope this is helpfull for you.
(adsbygoogle = window.adsbygoogle || []).push({});

The following 11 users say thank you to xQuZe- for this useful post:

-Google-, Bang Tidy, DarKMaGiiC, FrozN, hydro_122499, Ju1cy, Plurals, pois0n, Skyl1n3, ViiZiiKz, xT4sSin
02-21-2011, 06:01 PM #20
xQuZe-
You talkin to me?
Originally posted by Platypus View Post
ok still pretty coolio though


Yea i love the bar lol. I think it's pretty cool.
02-21-2011, 09:20 PM #21
Woof
...hmm
Nice tutorial, may help some people,
Lol i made my own progress bar that i use, it looks more sexy Winky Winky
and you can customize allot more.
02-22-2011, 05:27 PM #22
xQuZe-
You talkin to me?
Originally posted by BadMan
Nice tutorial, may help some people,
Lol i made my own progress bar that i use, it looks more sexy Winky Winky
and you can customize allot more.


Yea probaly lol. I just made it simple for nubbz
02-23-2011, 05:47 AM #23
cool never knew that was how you could do this wish i could still host to try this out
02-23-2011, 06:27 AM #24
could you change the shaders of the bar?
02-23-2011, 02:48 PM #25
xQuZe-
You talkin to me?
Originally posted by Sn1PaXx View Post
could you change the shaders of the bar?


Idk probaly not.
02-23-2011, 04:36 PM #26
Thanks for making the tutorial straightforward and easy
02-23-2011, 04:43 PM #27
might come in handy, thx Smile
02-23-2011, 09:01 PM #28
xQuZe-
You talkin to me?
Originally posted by Dynamiikz View Post
Thanks for making the tutorial straightforward and easy


Originally posted by Carlit0uz View Post
might come in handy, thx Smile


Your welcome Awesome face

The following user thanked xQuZe- for this useful post:

TheKing054

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo