PDA

View Full Version : Time countdown


Fantje
10/10/2015, 12:09 PM
Heey guys,

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

Example:

http://imgur.com/44sWuqV.png

Peace

AbyssMorgan
10/10/2015, 12:38 PM
http://forum.sa-mp.com/showthread.php?t=591209

I have already written how to do

Fantje
10/10/2015, 12:49 PM
http://forum.sa-mp.com/showthread.php?t=591209

I have already written how to do

It don't really work. It starts from -1:40 and when that times up, it starts from -3:00. really wierd xd

http://imgur.com/rRsOvEV.png

AbyssMorgan
10/10/2015, 12:52 PM
because I said that the start value is 0 and no 300

Fantje
10/10/2015, 12:59 PM
because I said that the start value is 0 and no 300

So how to fix?

AbyssMorgan
10/10/2015, 01:00 PM
START: timecnt = 0, timestop = 300

every second:

timecnt++; // 1 2 3 4 ... 300
new timessek, timesmin;
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

Fantje
10/10/2015, 01:24 PM
START: timecnt = 0, timestop = 300

every second:

timecnt++; // 1 2 3 4 ... 300
new timessek, timesmin;
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?

AbyssMorgan
10/10/2015, 01:26 PM
Example:
new mytimer;

//Start
mytimer = SetTimer("CountDownTimer", 1000, 1);

//Stop
KillTimer(mytimer);

Fantje
10/10/2015, 01:41 PM
Example:
new mytimer;

//Start
mytimer = SetTimer("CountDownTimer", 1000, 1);

//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 ).

Fantje
10/10/2015, 02:31 PM
Anyone fix for ast problem?

jlalt
10/10/2015, 02:34 PM
Anyone fix for ast problem?

put the timer on every gamemode you wanna use by SendRconCommand(changemode)