countdown help [++REP]
#1

-Solved-
Reply
#2

bump
Reply
#3

bump!
Reply
#4

Search on ****** minutes to milliseconds converter and simply convert the number and apply it to your timer, please do not bump the topic every few minutes.
Reply
#5

PHP код:
new SecondCount 0;
new 
MaxSeconds 600;
new 
CountTimer;
forward Counter();
public 
Counter()
{
    
SecondCount++;
    new 
string[256];
    new 
timeremaining MaxSeconds SecondCount;
    
//if(timeremaining == 0) {
    //Either add code here for when the timer runs out
    //}
    
for(new i=0;i<MAX_PLAYERS;i++) {
            if(
timeremaining == 0) {
            
format(stringsizeof(string), "The timer has run out");
            
SendClientMessage(i0xFF0000FFstring);
            
//KillTimer(CountTimer);//Example
            //SecondCount = 0;//Example
            // or here for when the timer runs out for every specific player
            
} else {
            
format(stringsizeof(string), "%d remaining!",timeremaining);
            
SendClientMessage(i0xFF0000FFstring);
            }
    }
    return 
1;
}
CountTimer SetTimerEx("Counter"1*1000true"d");// add where you want to start the timer.
KillTimer(CountTimer);// add where you wanna kill the timer
SecondCount 0;// add where you wanna reset seconds of counter 
If you need help converting seconds to minutes and hours and such tell me.
Reply
#6

Just made this real quick incase you do need it, just replace second format with this:

PHP код:
new seconds SecondCountminutes;
while(
seconds 59)
{
    
seconds -= 60;
    
minutes++;
}
format(stringsizeof(string), "%02d:%02d remaining!",minutes,seconds); 
Reply
#7

Quote:
Originally Posted by Glenn332
Посмотреть сообщение
PHP код:
new SecondCount 0;
new 
MaxSeconds 600;
new 
CountTimer;
forward Counter();
public 
Counter()
{
    
SecondCount++;
    new 
string[256];
    new 
timeremaining MaxSeconds SecondCount;
    
//if(timeremaining == 0) {
    //Either add code here for when the timer runs out
    //}
    
for(new i=0;i<MAX_PLAYERS;i++) {
            if(
timeremaining == 0) {
            
format(stringsizeof(string), "The timer has run out");
            
SendClientMessage(i0xFF0000FFstring);
            
//KillTimer(CountTimer);//Example
            //SecondCount = 0;//Example
            // or here for when the timer runs out for every specific player
            
} else {
            
format(stringsizeof(string), "%d remaining!",timeremaining);
            
SendClientMessage(i0xFF0000FFstring);
            }
    }
    return 
1;
}
CountTimer SetTimerEx("Counter"1*1000true"d");// add where you want to start the timer.
KillTimer(CountTimer);// add where you wanna kill the timer
SecondCount 0;// add where you wanna reset seconds of counter 
If you need help converting seconds to minutes and hours and such tell me.
thnx +rep
Reply
#8

Quote:
Originally Posted by simo0000
Посмотреть сообщение
thnx +rep
Thanks bud check this aswell,

Quote:

Just made this real quick incase you do need it, just replace second format with this:

PHP код:
new seconds SecondCountminutes;
while(
seconds 59)
{
    
seconds -= 60;
    
minutes++;
}
format(stringsizeof(string), "%02d:%02d remaining!",minutes,seconds); 
Reply
#9

Quote:
Originally Posted by Glenn332
Посмотреть сообщение
Thanks bud check this aswell,
yes it's working perfect thnx
Reply
#10

Quote:
Originally Posted by simo0000
Посмотреть сообщение
yes it's working perfect thnx
No problem.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)