SA-MP Forums Archive
halt function lags server like hell - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: halt function lags server like hell (/showthread.php?tid=76367)



halt function lags server like hell - CJ101 - 04.05.2009

Just downloaded this friggin thing and when the halt code is executed, the server lags like hell. after the halt is done, it goes back to normal. any suggestions?

Код:
halt(seconds)
{
	new _newTime[4], _oldTime[4];
	gettime(_oldTime[0], _oldTime[1], _oldTime[2]);
	_oldTime[3] = _oldTime[2] + (_oldTime[1] * 60) + (_oldTime[0] * 600);

	while(_newTime[3] != (_oldTime[3] + seconds))
	{
		gettime(_newTime[0], _newTime[1], _newTime[2]);
		_newTime[3] = _newTime[2] + (_newTime[1] * 60) + (_newTime[0] * 600);
	}
}



Re: halt function lags server like hell - Joe Staff - 04.05.2009

That's what halt is supposed to do from looking at the code.


Re: halt function lags server like hell - Andom - 04.05.2009

It taked more then 1 second to execute this function? then you have a really big problem dude.

Why using arrays? you wasting memory like hell, remove the arrays.


Re: halt function lags server like hell - -Rebel Son- - 07.04.2010

Halt is suppost to, When a halt is executed, it Freezes the server. Not what your halting.