Get Timer Time
#1

Is there a way to get a time from the timer? Like /time and it says "(time) left on the timer" It would be nice if it could be in seconds in the command instead of milliseconds but anything is fine for now. I already have the timer function set up
Reply
#2

There is no func for it now but i guess you could use another timer which repeats every second (var++ in it?)
and when just subtract the total time of the main timer - var to get the remaining time
Reply
#3

Well, i mean set a timer JUST to time.. if you know what im saying. Like the only function for this timer is to countdown and show you the time left of that timer.
Reply
#4

pawn Код:
//declares
new timeractive;
new sec;
new seccounttimer;
//when u set timers
SetTimer("maintime",sometime,false);
timeractive=1;
seccounttimer=SetTimerEx("seccount",1000,true,"d",playerid);
//publics
forward seccount(playerid);
public seccount(playerid);
{
    if(timeractive == 0) KillTimer(secounttimer);
    sec++;
    return 1;
}
//checking timeleft
timeleft = sometime/1000 - sec; // sometime/10 to convert it to seconds and subtract the seconds elapsed since the start of the timer
Reply
#5

Ill test that when i get home :P thanks
Reply
#6

How about setting a TD that starts at X time and just counts down
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)