Auto Spawn
#3

Quote:
Originally Posted by MEW273
Посмотреть сообщение
Hi Maro06,

I would take your code under OnPlayerRequestClass and create a new public like so:
Код:
forward OnPlayerConnected(playerid);
public OnPlayerConnected(playerid)
{
	SetSpawnInfo(playerid, TEAM_NONE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
	SpawnPlayer(playerid);
	return 1;
}
Then under your OnPlayerConnect (do not get this confused with the new public created above OnPlayerConnected) call your new public like so:

Код:
OnPlayerConnect(playerid)
{
	SetTimerEx("OnPlayerConnected",  5000, false, "i", playerid)
	// All your other OnPlayerConnect code.
	return 1;
}
I believe you need to wait as the player connects before you can spawn them as if you force spawn directly under OnPlayerConnect it may not work as the player may still be in the process of connecting.

Give this a try and let me know if you run into any errors - there may be a better way of doing this, but I was having the same problem and searched and searched for solutions and this is the only working method I could find.
Thanks but, it is still the same buddy.
Reply


Messages In This Thread
Auto Spawn - by Ghazal - 25.05.2015, 10:41
Re: Auto Spawn - by MEW273 - 25.05.2015, 10:52
Re: Auto Spawn - by Ghazal - 25.05.2015, 11:32
Re: Auto Spawn - by MEW273 - 25.05.2015, 12:03
Re: Auto Spawn - by Ghazal - 25.05.2015, 12:47

Forum Jump:


Users browsing this thread: 1 Guest(s)