Timer time left - 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: Timer time left (
/showthread.php?tid=657984)
Timer time left -
,TomY' - 19.08.2018
Hi. How to get time left from timer? I need to get time, that left to end of this timer.
My timer:
Код:
SetTimerEx("eventend", 1000*60*10, false,"");
Re: Timer time left -
Zamora - 20.08.2018
Код:
evendendtime = 10/60; // Instead of the settimer
Код:
new str[128];
if(evendendtime)
{
format(str, sizeof(str), "bla bla bla %d", evendendtime);
SendClientMessage(playerid, -1, str);
return 1;
}
Re: Timer time left -
Sew_Sumi - 20.08.2018
Quote:
Originally Posted by Zamora
Код:
evendendtime = 10/60; // Instead of the settimer
Код:
new str[128];
if(evendendtime)
{
format(str, sizeof(str), "bla bla bla %d", evendendtime);
SendClientMessage(playerid, -1, str);
return 1;
}
|
lol what in the fuck...
OP... Use a few timers. Say for instance you have a 10 minute round,want a 2 minute warning, along with a 20 second countdown.
First timer runs for 8 minutes, then fires the 2 minute warning, invoking the timer for 100 seconds, last timer is a tick timer, running for 21 seconds, so you can do 20-15-10-5-4-3-2-1-finish countdown.
Along with this, you could use something to check that your timers are semi-accurate by counting the ms they are, and comparing them to GetTick(**?) and just making sure they aren't stalling, or falling out of step.
There are other scenarios where this can also apply, what's the scenario you are doing this in?