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-20-2011, 08:26 PM #11
Originally posted by xQuZe
Lmao i just added it xD.


yeah I know and i didn't read the thanks to me, so i thought, I failed lolHappy
02-20-2011, 08:27 PM #12
xQuZe-
You talkin to me?
Originally posted by Ju1cy View Post
yeah I know and i didn't read the thanks to me, so i thought, I failed lolHappy


So it actually worked?
02-20-2011, 08:29 PM #13
Originally posted by xQuZe
So it actually worked?


Yes it does.
02-20-2011, 08:30 PM #14
xQuZe-
You talkin to me?
Originally posted by Ju1cy View Post
Yes it does.


haha ZOmg xD. Re-added
02-20-2011, 08:31 PM #15
could you do this?

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)*10) );
useBarText setText( "Downloading Awesome!");
useBar updateBar( barPercent / 10 );

wait ( 0.04 );
}
useBar destroyElem();
useBarText destroyElem();
}
02-20-2011, 08:33 PM #16
xQuZe-
You talkin to me?
Originally posted by Sn1PaXx View Post
could you do this?


    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)*10) );
useBarText setText( "Downloading Awesome! ");
useBar updateBar( barPercent / 10 );

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


sec i test it for you
Edit. It does work. Happy
02-20-2011, 10:30 PM #17
The_Platypus
Live Life, Play Cod
could you possibly change the coulors of the bar
02-21-2011, 02:08 PM #18
xQuZe-
You talkin to me?
Originally posted by Platypus View Post
could you possibly change the coulors of the bar


Nope, i have tried everything. Like add glowcolor orso. But nothing worked :(
02-21-2011, 03:01 PM #19
The_Platypus
Live Life, Play Cod
ok still pretty coolio though

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo