12.06.2012, 10:29
Hello everybody.Can someone explain me better this progress bar?? please.Thanks
This forum requires that you wait 120 seconds between posts. Please try again in 66 seconds.
forward Timer();
public OnGameModeInit()
{
SetTimer("Timer",interval,repeat?);
return 1;
}
public Timer()
{
// Timer function code here...
//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;
}
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 Код:
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. |