SA-MP Forums Archive
Get Timer Time - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Get Timer Time (/showthread.php?tid=324292)



Get Timer Time - SnG.Scot_MisCuDI - 09.03.2012

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


Re: Get Timer Time - eesh - 09.03.2012

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


Re: Get Timer Time - SnG.Scot_MisCuDI - 09.03.2012

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.


Re: Get Timer Time - eesh - 09.03.2012

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



Re: Get Timer Time - SnG.Scot_MisCuDI - 09.03.2012

Ill test that when i get home :P thanks


Re: Get Timer Time - SnG.Scot_MisCuDI - 09.03.2012

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