SetSpawnInfo throws me into classselection
#1

When I use SetSpawnInfo in OnPlayerDeath, the server respawns me in the class-selection.

Example:
Код:
                new rand = random(4);
                SetSpawnInfoEx(playerid, NO_TEAM, GetPlayerSkin(playerid), WorldSpawns[rand][0], WorldSpawns[rand][1], WorldSpawns[rand][2] + 3.0, WorldSpawns[rand][3]);
This does not happen always.

Edit:
Sorry, forgot to post this:
Код:
SetSpawnInfoEx(playerid, team, skin, Float:x, Float:y, Float:z, Float:Angle)
{
	return SetSpawnInfo(playerid, team, skin, x, y, z, Angle, 0, 0, 0, 0, 0, 0);
}
Reply
#2

What's your SetSpawnInfoEx code?
Reply
#3

That's not a native function, so it is more likely that the bug is in whatever code you wrote for it, not in the fact that you are eventually using "SetSpawnInfo", as the title implies.
Reply
#4

Sorry! I've edited the post.
Reply
#5

You call GetPlayerSkin but what if the player has just connected to the server? That may cause an issue...
Reply
#6

Quote:
Originally Posted by Abagail
Посмотреть сообщение
You call GetPlayerSkin but what if the player has just connected to the server? That may cause an issue...
I call it in OnPlayerDeath, the player must have a skin.
Reply
#7

If you are only changing the position why don't you use SetPlayerPos in OnPlayerSpawn ?
Reply
#8

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
If you are only changing the position why don't you use SetPlayerPos in OnPlayerSpawn ?
Because I have noticed that for some laggy players it takes up to 2 seconds until SetPlayerPos applies in OnPlayerSpawn.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)