Flaker Posted February 23, 2012 Posted February 23, 2012 Доброго времени суток. Подскажите пожалуста как сделать проверку прогресса, прогресс-бара? То есть если guiProgressBarSetProgress = 1 то увеличивать прогресс, но как только становиться равным 100, переходить к другому действию?
Kenix Posted February 23, 2012 Posted February 23, 2012 Сделай таймер и проверяй в нём. Если сходится , то убивай таймер и вызывай дальше , что нужно тебе.
Flaker Posted February 23, 2012 Author Posted February 23, 2012 Если не сложно, выложи примерчик какой нибудь. Просто пытался уже, не совсем получаеться(
Kernell Posted February 23, 2012 Posted February 23, 2012 Покажи код где ты увеличиваешь прогресс в прогресс-баре.
Flaker Posted February 23, 2012 Author Posted February 23, 2012 Вот вобщем-то: GUIEditor_Progress = {} GUIEditor_Progress[1] = guiCreateProgressBar(0.0127,0.4193,0.1719,0.0417,true) guiSetAlpha(GUIEditor_Progress[1],1) percent1 = 1 function move_progressbar () function chech_move () percent1 = percent1 + 1 guiProgressBarSetProgress(GUIEditor_Progress[1],percent1) end setTimer(chech_move,200,100) end addCommandHandler ( "12", move_progressbar )
Kernell Posted February 23, 2012 Posted February 23, 2012 GUIEditor_Progress = {} GUIEditor_Progress[1] = guiCreateProgressBar(0.0127,0.4193,0.1719,0.0417,true) guiSetAlpha(GUIEditor_Progress[1],1) percent1 = 1 timer = nil; function move_progressbar () if timer then return end function chech_move () percent1 = percent1 + 1 guiProgressBarSetProgress(GUIEditor_Progress[1],percent1) if guiProgressBarGetProgress(GUIEditor_Progress[1]) >= 100 then print "переходим к другому действию" killTimer( timer ) timer = nil; end end timer = setTimer(chech_move,200,100) end addCommandHandler ( "12", move_progressbar )
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now