Progress Bar
#1

Hello everybody.Can someone explain me better this progress bar?? please.Thanks
Reply
#2

What you didn't understand? Be more specific

pawn Код:
This forum requires that you wait 120 seconds between posts. Please try again in 66 seconds.
- This is killing me -.-
Reply
#3

Quote:
Originally Posted by zombieking
Посмотреть сообщение
What you didn't understand? Be more specific

pawn Код:
This forum requires that you wait 120 seconds between posts. Please try again in 66 seconds.
- This is killing me -.-
How to set up the timers and principle how is working.
Reply
#4

How to create a timer:

pawn Код:
forward Timer();
public OnGameModeInit()
{
SetTimer("Timer",interval,repeat?);
return 1;
}
public Timer()
{
 // Timer function code here...
Reply
#5

Quote:
Originally Posted by zombieking
Посмотреть сообщение
How to create a timer:

pawn Код:
forward Timer();
public OnGameModeInit()
{
SetTimer("Timer",interval,repeat?);
return 1;
}
public Timer()
{
 // Timer function code here...
I mean how to create that progress bar to work...better explains
Reply
#6

Read the damn thread. The author explains how to use it in code examples.
Reply
#7

Quote:
Originally Posted by VincentDunn
Посмотреть сообщение
Read the damn thread. The author explains how to use it in code examples.
Look.I read that topic 3 times.But I don`t understand that codes.
Reply
#8

well you have

SetProgressBarValue to set the value and
UpdateProgressBar to update the value.
so as the timer runs you can increase the progress each time,
use GetProgressBarValue to check for 100%




so heres the code example
pawn Код:
//to start the timer for a bar
    SetTimerEx("ProgressTimer",interval,false,"ii",barid,interval);

forward ProgressTimer(barid,interval);
public ProgressTimer(barid,interval)
{
    Float:lPBarVal = GetProgressBarValue(barid);
    if (lPBarVal < 100.0)
    {
        SetProgressBarValue(barid, lPBarVal+10.0)
        UpdateProgressBar(barid);
        SetTimerEx("ProgressTimer",interval,false,"i",barid);
    }
    return 1;
}
now i did not account for allot like INVALID_BAR_ID, for that you should read the progress bar topic,
also i never used that include so did not test this code, its only an example.
I gathered all the info from that topic and the wiki just now.
Reply
#9

Quote:
Originally Posted by Jonny5
Посмотреть сообщение
well you have

SetProgressBarValue to set the value and
UpdateProgressBar to update the value.
so as the timer runs you can increase the progress each time,
use GetProgressBarValue to check for 100%




so heres the code example
pawn Код:
//to start the timer for a bar
    SetTimerEx("ProgressTimer",interval,false,"ii",barid,interval);

forward ProgressTimer(barid,interval);
public ProgressTimer(barid,interval)
{
    Float:lPBarVal = GetProgressBarValue(barid);
    if (lPBarVal < 100.0)
    {
        SetProgressBarValue(barid, lPBarVal+10.0)
        UpdateProgressBar(barid);
        SetTimerEx("ProgressTimer",interval,false,"i",barid);
    }
    return 1;
}
now i did not account for allot like INVALID_BAR_ID, for that you should read the progress bar topic,
also i never used that include so did not test this code, its only an example.
I gathered all the info from that topic and the wiki just now.
Aha.Thanks for explains...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)