Time countdown
#1

Heey guys,

I need some help with a countdown. So it countdown from 05:00 to 00:00 ( minutes ).

Example:



Peace
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=591209

I have already written how to do
Reply
#3

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
It don't really work. It starts from -1:40 and when that times up, it starts from -3:00. really wierd xd

Reply
#4

because I said that the start value is 0 and no 300
Reply
#5

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
because I said that the start value is 0 and no 300
So how to fix?
Reply
#6

START: timecnt = 0, timestop = 300

every second:
PHP код:
timecnt++; // 1 2 3 4 ... 300
new timessektimesmin;
timesmin = ((timestop-timecnt)/60);
timessek = (timestop-(timecnt+(timesmin*60)));
format(buffer,sizeof buffer,"%02d:%02d",timesmin,timessek);
//show time
if(timecnt == timestop){
    
//The End
    
timecnt 0//reset

//edit: despite counting upwards, it shows the time down: 5:00 4:59 ... 0:00

Example:
https://www.youtube.com/watch?v=desa4vyIHGs
countup, time down
Reply
#7

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
START: timecnt = 0, timestop = 300

every second:
PHP код:
timecnt++; // 1 2 3 4 ... 300
new timessektimesmin;
timesmin = ((timestop-timecnt)/60);
timessek = (timestop-(timecnt+(timesmin*60)));
format(buffer,sizeof buffer,"%02d:%02d",timesmin,timessek);
//show time
if(timecnt == timestop){
    
//The End
    
timecnt 0//reset

//edit: despite counting upwards, it shows the time down: 5:00 4:59 ... 0:00

Example:
https://www.youtube.com/watch?v=desa4vyIHGs
countup, time down
Okay it works but the only problem is that I can't kill the timer. But I have to kill it so how?
Reply
#8

Example:
PHP код:
new mytimer;

//Start
mytimer SetTimer("CountDownTimer"10001);  

//Stop
KillTimer(mytimer); 
Reply
#9

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
Example:
PHP код:
new mytimer;
//Start
mytimer SetTimer("CountDownTimer"10001);  
//Stop
KillTimer(mytimer); 
Okay that works. Now: The timer works and stops at 00:00 and then the server restarts (SendRconCommand(changemode) and when the new mission starts the timer won't show up. When I type rcon reloadfs ASystemv1 it shows up. ( Yes my timer is in a admin system ).
Reply
#10

Anyone fix for ast problem?
Reply


Forum Jump:


Users browsing this thread: