SA-MP Forums Archive
Delay class selection - 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: Delay class selection (/showthread.php?tid=76795)



Delay class selection - Rks25 - 06.05.2009

I heard people , : 'put lots of things in OnPlayerConnect'.

but that won't help if you are making a new gamemode. What is a good solution to the problem of delaying the class selection.
Because i see the Class Selection to fast.


Re: Delay class selection - seven - 06.05.2009

as far as i know this isnt possible


Re: Delay class selection - Backwardsman97 - 07.05.2009

Force the player spawn on connect and set their camera some where. Then set a timer to force class selection and kill them?


Re: Delay class selection - Rks25 - 07.05.2009

that is a bit weird... At a lot of servers like partyserver, i see that bridge for quite long alon with textdraw.. how to do so?


Re: Delay class selection - NeRoSiS - 07.05.2009

Thats probably just because they have fuck loads of data to read and write onplayerconnect? And it doesn't quite get round to the class selection screen until tht is done.

Anyway, try putting this function in.

Код:
stock Wait(time)
{
	new stamp = tickcount();
	while (tickcount() - stamp < time)
	{
	}
	return 1;
}
Add that anywhere in the script, just under your defines maybe?

then use this function
Код:
Wait(time);
Good luck.


Re: Delay class selection - Rks25 - 07.05.2009

And if i do Wait(10);

1) Will it hold for 10 sec and resume after that automatically?


Re: Delay class selection - Weirdosport - 07.05.2009

10 = 10 milliseconds, you need 10,000 (without the comma)


Re: Delay class selection - Rks25 - 07.05.2009

But still will it hold for 10 sec and will it resume to class selection after those 10 sec?


Re: Delay class selection - NeRoSiS - 07.05.2009

Should do, give it a try.



Re: Delay class selection - Goldkiller - 07.05.2009

Dont use Wait().This will stop your server for the given XYms.
No sync will be done in this time,so your players will get annoyed :\.