Jump to content

[Help] Progress Bar


Markeloff

Recommended Posts

Posted

Well, I have no code to post, but I wanted to ask about how to guiProgressBarSetProgress with setTimer.

I want to make the progress bar increase by the time. For Example : 30 seconds makes 20% of the bar.

430x73_B2E03D_FF9900_000000_000000.png

Some people want it to happen, some wish it would happen, others make it happen.

Posted
setTimer 
guiProgressBarGetProgress 
guiProgressBarSetProgress 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
local currprog = guiProgressBarGetProgress(progressbar) 
setTimer ( function() 
guiProgressBarSetProgress(progressbar,20) 
end, 30000, 1 ) 

This made 20% for one time only, means the first only no next increase. How to make it make the progress every 30 secs.

430x73_B2E03D_FF9900_000000_000000.png

Some people want it to happen, some wish it would happen, others make it happen.

Posted

Change that "1" to "5", so the timer is executed 5 times instead of just once.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
local currprog = guiProgressBarGetProgress(progressbar) 
setTimer ( function() 
guiProgressBarSetProgress(progressbar,currprog+20) 
end, 30000, 5 ) 
  

Doesn't work.

430x73_B2E03D_FF9900_000000_000000.png

Some people want it to happen, some wish it would happen, others make it happen.

Posted

That's because you are only getting the current progress once, move it inside the same function.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You're welcome.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...