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-24-2011, 07:44 PM #29
xMoonman-
Do a barrel roll!
I dont get it? what does it do? Keeps track of what progress?
02-24-2011, 08:37 PM #30
xQuZe-
You talkin to me?
Originally posted by xMoonman
I dont get it? what does it do? Keeps track of what progress?


It create's a loading/progress bar on your screen.
02-24-2011, 09:31 PM #31
xMoonman-
Do a barrel roll!
Originally posted by xQuZe
It create's a loading/progress bar on your screen.


pretty much pointless?
02-24-2011, 09:43 PM #32
xQuZe-
You talkin to me?
Originally posted by xMoonman
pretty much pointless?


Lmao wtf are you doing here then? /facepalm
02-24-2011, 10:07 PM #33
xMoonman-
Do a barrel roll!
Originally posted by xQuZe
Lmao wtf are you doing here then? /facepalm


haha no im just saying. well its pointless for me haha cause i just **** around when i play and love to piss people off
02-24-2011, 11:46 PM #34
I am Mara
Can I Haz Kebab?
Thank you<3
02-25-2011, 06:37 AM #35
xQuZe-
You talkin to me?
Originally posted by xMoonman
haha no im just saying. well its pointless for me haha cause i just **** around when i play and love to piss people off


hahaha :carling:
02-25-2011, 08:54 AM #36
Thank's for the Progress Bar it's really a great help to me Thank You
02-25-2011, 12:25 PM #37
xQuZe-
You talkin to me?
Originally posted by pipoi26 View Post
Thank's for the Progress Bar it's really a great help to me Thank You


Your welcome mate Smile
Progress bar is cool huh? Happy

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo