Jump to content

Progress bar


Spice

Recommended Posts

function createprog () 
loadingprog = guiCreateProgressBar(475, 653, 330, 33, false) 
curprog = guiProgressBarGetProgress (loadingprog) 
setTimer (guiProgressBarSetProgress, 1000, 10, loadingprog, curprog+10) 
setTimer (destroyElement, 10010, 1, loadingprog) 
end 

Why the progress bar don't increase except once (to 10 %) ?

Why the progress bar don't get destroyed after 10 secs

Link to comment

Try:

  
function createprog () 
    loadingprog = guiCreateProgressBar(475, 653, 330, 33, false) 
    setTimer (progress, 1000, 10) 
    setTimer (destroyElement, 10010, 1, loadingprog) 
end 
  
function progress() 
    curprog = guiProgressBarGetProgress (loadingprog) 
    guiProgressBarSetProgress(loadingprog, curprog+10) 
end 
  

Link to comment

I tested this and worked fine with me

function createprog () 
  
loadingprog = guiCreateProgressBar(475, 653, 330, 33, false) 
curprog = guiProgressBarGetProgress (loadingprog) 
guiProgressBarSetProgress(loadingprog,curprog) 
end 
  
setTimer(function() 
curprog = curprog+10 
guiProgressBarSetProgress(loadingprog,curprog) 
end,1000, 10) 
  
  
setTimer(function() 
destroyElement (loadingprog) 
end, 10000, 1) 

Link to comment

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...