TogglePlayerSpectating + SetPlayerPos
#1

So basicly when I do this under OnPlayerSpawn:
pawn Код:
TogglePlayerSpectating(playerid, false);
SetPlayerPos(playerid, enumarray[pid][X], enumarray[pid][Y], enumarray[pid][Z]);
printf("OnSpawn X: %f, Y: %f, Z: %f",enumarray[pid][X], enumarray[pid][Y], enumarray[pid][Z]);
It calls OnPlayerSpawn twice, and spawns the player on the coords stated in AddPlayerClass, instead of SetPlayerPos. The weird thing is, that the enumarray[pid][*] values are changed as well, here's the console output. LoadPlayer is the coordinates loaded from the SQL, OnSpawn is the code above, which is under OnPlayerSpawn callback:

Код:
[23:20:07] LoadPlayer X: 1495.380004, Y: -700.083007, Z: 94.750000
[23:20:07] OnSpawn X: 1495.380004, Y: -700.083007, Z: 94.750000
[23:20:07] OnSpawn X: 816.750671, Y: -1361.655273, Z: -0.507799 // Coords from AddPlayerClass, also under OnPlayerDeath, the enumarray[pid][*] is changed to these coords
So.. yeah. The problem is, that it doesn't spawn the coords from SQL, or LoadPlayer. But instead spawns player "twice". I use the TogglePlayerSpectating, to get rid of the "Spawn Buttons" on player connect. Any workarounds?
Reply


Messages In This Thread
TogglePlayerSpectating + SetPlayerPos - by TheXIII - 22.11.2010, 20:21
Re: TogglePlayerSpectating + SetPlayerPos - by TheXIII - 22.11.2010, 22:35
Re: TogglePlayerSpectating + SetPlayerPos - by bigcomfycouch - 22.11.2010, 22:37
Re: TogglePlayerSpectating + SetPlayerPos - by TheXIII - 22.11.2010, 23:31
Re: TogglePlayerSpectating + SetPlayerPos - by ReVo_ - 19.08.2012, 13:02

Forum Jump:


Users browsing this thread: 1 Guest(s)