22.11.2010, 20:21
So basicly when I do this under OnPlayerSpawn:
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:
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?
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]);
Код:
[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