Jump to content

How can I use For ...


Booo

Recommended Posts

Posted (edited)

hola all

how can I use For with guiProgressBarGetProgress

  
        bar = guiCreateProgressBar ( 50, 50, 100, 70, false ) 
        getprogress = guiProgressBarGetProgress(bar) 
  
        setTimer (function() 
        guiProgressBarSetProgress ( bar,20 ) 
        end, 1000, 1) 
  
         for k,v in pairs(getprogress) do 
              if v  == 20 then  
                  outputChatBox("ProgressBar = 20") 
              elseif v == 40 then  
                 outputChatBox("ProgressBar = 40") 
               end 
         end 
  

Edited by Guest

تذكر عند تصفحك للأنترنت قوله تعالى: (( وهو معكم أين ما كنتم والله بما تعملون بصير )) ا

Posted

This can't work because every 10 seconds the progress bar is set to 20% (doesn't make sense)

setTimer (function() 
        guiProgressBarSetProgress ( bar,20 ) 
        end, 1000, 0) 

And why do you want to use

for 

?

Currently working on gamemodes :

  • Reallife Script 70%
  • Breakout Script 10%
Posted (edited)
This can't work because every 10 seconds the progress bar is set to 20% (doesn't make sense)
setTimer (function() 
        guiProgressBarSetProgress ( bar,20 ) 
        end, 1000, 0) 

And why do you want to use

for 

?

1000 = 1 seconds

not 10 seconds !!

And not given for an example of the attention it np example

I want to use For with guiProgressBargetProgress ..

can you help me

Edited by Guest

تذكر عند تصفحك للأنترنت قوله تعالى: (( وهو معكم أين ما كنتم والله بما تعملون بصير )) ا

Posted

If you are trying to use for loop for animation, then you are on the wrong track.

setTimer (function() 
        guiProgressBarSetProgress(bar, guiProgressBarGetProgress(bar)+10) 
end, 1000, 0) 

maybe thats somewhat like what you are trying to do?

Posted
CTimer = { }          
  
bar = guiCreateProgressBar ( 50, 50, 100, 70, false ) 
  
CTimer [ localPlayer ] = setTimer ( 
    function ( ) 
        guiProgressBarSetProgress ( bar, guiProgressBarGetProgress ( bar ) + 20 ) 
         
        if ( guiProgressBarGetProgress ( bar ) == 100 ) then 
            killTimer ( CTimer [ localPlayer ] ) 
        end 
  
    end, 
1000, 0 ) 

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

Posted

lol , guys i need use For with guiProgressBarGetProgress

not setTimer

how can use For ?? It not work

تذكر عند تصفحك للأنترنت قوله تعالى: (( وهو معكم أين ما كنتم والله بما تعملون بصير )) ا

Posted

You don't need use for-loop.

Anyway, explain what you want to do.

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

Posted
You don't need use for-loop.

Anyway, explain what you want to do.

Draken i need use For with guiProgressBarGetProgress

and get Value guiProgressBarGetProgress if GetProgress == 20 outputChatBox("ProgressBar = 20 ")

look at the example

        bar = guiCreateProgressBar ( 50, 50, 100, 70, false ) 
        getprogress = guiProgressBarGetProgress(bar) 
  
        setTimer (function() 
        guiProgressBarSetProgress ( bar,20 ) 
        end, 1000, 1) 
  
         for k,v in pairs(getprogress) do 
              if v  == 20 then 
                  outputChatBox("ProgressBar = 20") 
              elseif v == 40 then 
                 outputChatBox("ProgressBar = 40") 
               end 
         end 

تذكر عند تصفحك للأنترنت قوله تعالى: (( وهو معكم أين ما كنتم والله بما تعملون بصير )) ا

Posted

And why the hell you need for-loop?

bar = guiCreateProgressBar ( 50, 50, 100, 70, false ) 
  
setTimer ( 
    function ( ) 
        guiProgressBarSetProgress ( bar, 20 ) 
        outputChatBox ( 'Progress Bar = ' .. guiProgressBarGetProgress ( bar ) ) 
    end, 
1000, 1 ) 

EPT Team Server Development: 0%

Learning C++ | C++ is amazing xD

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