Results 1 to 6 of 6

Thread: How I can make a Loadbar?

  1. #1
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts

    How I can make a Loadbar?

    Hello Guys, i need help, i wanted to ask how to make a loadbar (with seconds and how long it should be)

    as example: the loadbar ends in 5 secounds

    Can someone help me?

    Thanks

  2. #2
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Like looking like a health bar, with custom width/color/time?
    timescale 0.01

  3. #3
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Loadbar to load the map? or a progressbar to plant/defuse something?

  4. #4
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by Loveboy View Post
    Hello Guys, i need help, i wanted to ask how to make a loadbar (with seconds and how long it should be)

    as example: the loadbar ends in 5 secounds

    Can someone help me?

    Thanks
    Look in maps\mp\gametypes\hq.gsc. There are lots of examples of how to do a loadbar.

    And a loadbar is by definition how long it takes to finish. It seems pretty dumb to also have numbers. A loadbar is a graphical representation of numbers. It tells you how much time is left before its done. That would be like saying, "I want Windows desktop icons, but I also want numbers to tell me the position of the desktop icon". Just stupid.

    DOH!
    Last edited by Tally; 23rd September 2013 at 08:04.

  5. The Following User Says Thank You to Tally For This Useful Post:

    Loveboy (23rd September 2013)

  6. #5
    Private
    Join Date
    Jan 2013
    Location
    Hungary
    Posts
    113
    Thanks
    10
    Thanked 74 Times in 45 Posts
    I found it unnecessery, but i wrote the script (based on sd):
    PHP Code:
                    // .......
                    
    if(!isdefined(other.progressbar))
                    {
                        
    other.progressbar newClientHudElem(other);
                        
    other.progressbar.int(level.barsize / (-2.0));

                        if(
    level.splitscreen)
                            
    other.progressbar.70;
                        else
                            
    other.progressbar.104;

                        
    other.progressbar.alignX "left";
                        
    other.progressbar.alignY "middle";
                        
    other.progressbar.horzAlign "center_safearea";
                        
    other.progressbar.vertAlign "center_safearea";
                    }
                    
    other.progressbar setShader("white"08);
                    
    other.progressbar scaleOverTime(level.planttimelevel.barsize8);

                    
    // I added these lines ---->
                    
    if(!isdefined(other.progresstime))
                    {
                        
    other.progresstime newClientHudElem(other);
                        
    other.progresstime.int(level.barsize / (-2.0));
                        
    other.progresstime.80;
                        
    other.progresstime.alignX "left";
                        
    other.progresstime.alignY "middle";
                        
    other.progresstime.horzAlign "center_safearea";
                        
    other.progresstime.vertAlign "center_safearea";
                    }
                    
    other.progresstime setTenthsTimer(level.planttime);
                    
    // <----

                    
    other playsound("MP_bomb_plant");
                    
    other linkTo(self);
                    
    other disableWeapon();

                    
    self.progresstime 0;
                    while(
    isAlive(other) && other useButtonPressed() && (self.progresstime level.planttime))
                    {
                        
    self.progresstime += 0.05;
                        
    wait 0.05;
                    }
                    
    // ....... 
    And do not forget destroy the hud!

  7. The Following User Says Thank You to randall For This Useful Post:

    Loveboy (23rd September 2013)

  8. #6
    Private
    Join Date
    Feb 2013
    Location
    Poland
    Posts
    32
    Thanks
    33
    Thanked 27 Times in 8 Posts
    Enjoy this -> Progress bar.

  9. The Following 2 Users Say Thank You to BlancO For This Useful Post:

    Loveboy (23rd September 2013),YuriJurek (23rd September 2013)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •