SetTimer counts too fast
#1

Hi all. When I set my timer on GameModeInit with repeat every 1 second, it repeats every ~0,5 seconds.
Код HTML:
SetTimer("Second", 1000, true);

f_public: Second()
{
	new String[30];

	for(new i; i <= GetPlayerPoolSize(); i++)
	{
		if(PI[i][Jailed])
		{
			if(PI[i][JailTime] > 0)
			{
				PI[i][JailTime] --;

				format(String, sizeof(String), "%s", ConvertSeconds(PI[i][JailTime]));
				GameTextForPlayer(i, String, 1000, 6);
			}
			else
			{
				UnjailPlayer(i);
			}
		}
	}

	return 1;
}
Reply
#2

How you know that?
Reply
#3

Maybe you've set more then a timer, it happened to me once.
Reply
#4

Quote:
Originally Posted by iLearner
Посмотреть сообщение
Maybe you've set more then a timer, it happened to me once.
No :/

EDIT: fixed it
Reply
#5

https://sampforum.blast.hk/showthread.php?tid=289675
https://github.com/udan11/samp-plugin-timerfix
https://sampforum.blast.hk/showthread.php?tid=571505

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)