SetSpawnInfo throws me into classselection -
Mellnik - 15.02.2014
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);
}
Re: SetSpawnInfo throws me into classselection -
Abagail - 15.02.2014
What's your SetSpawnInfoEx code?
Re: SetSpawnInfo throws me into classselection -
ColeMiner - 15.02.2014
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.
AW: SetSpawnInfo throws me into classselection -
Mellnik - 15.02.2014
Sorry! I've edited the post.
Re: SetSpawnInfo throws me into classselection -
Abagail - 15.02.2014
You call GetPlayerSkin but what if the player has just connected to the server? That may cause an issue...
AW: Re: SetSpawnInfo throws me into classselection -
Mellnik - 15.02.2014
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.
AW: SetSpawnInfo throws me into classselection -
Nero_3D - 15.02.2014
If you are only changing the position why don't you use SetPlayerPos in OnPlayerSpawn ?
AW: SetSpawnInfo throws me into classselection -
Mellnik - 15.02.2014
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.