SA-MP Forums Archive
Wait Function - 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: Wait Function (/showthread.php?tid=83795)



Wait Function - ledzep - 27.06.2009

In case anyone needs it.
If it has already been posted before, I apologize.

Note: Basically 'freezes' your code for 'x' amount of seconds.

Код:
Wait(milliseconds)
{
	new ticks = GetTickCount() + milliseconds;
	while(ticks > GetTickCount())
	{
	  // waiting patiently...
	}
}



Re: Wait Function - Weirdosport - 27.06.2009

As has been said many times, PAWN is single threaded, and this will interrupt the function of the entire script..

Or something to that effect..


Re: Wait Function - ledzep - 27.06.2009

That's why I only use it for things like looping connect attempts.


Re: Wait Function - Weirdosport - 27.06.2009

Basically when you run this everything on the server will stop for everybody...


Re: Wait Function - ledzep - 27.06.2009

I thought you stated it pretty well in your first post, but yes.

I'm pretty sure that is also how the pawno function "delay" works.