Setting Player Pos - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Setting Player Pos (
/showthread.php?tid=274467)
Setting Player Pos -
Kitten - 06.08.2011
Solved
Re: Setting Player Pos -
Lorenc_ - 06.08.2011
Set a timer (non-repeated) at 1500 ms on "onplayerspawn" and see what you get
Re: Setting Player Pos -
=WoR=Varth - 06.08.2011
Try to use
https://sampwiki.blast.hk/wiki/SetSpawnInfo.
Re: Setting Player Pos -
iPLEOMAX - 06.08.2011
You want the spawn position to be
2531.3379,-1665.7101,15.1674?
Why not just assign the values directly to the enum?
SaveMyPos[playerid][x] = 2531.3379;
SaveMyPos[playerid][y] = -1665.7101;
SaveMyPos[playerid][z] = 15.1674;
Re: Setting Player Pos -
Jeffry - 06.08.2011
GetPlayerPos is actually called when the player is still at his/her old pos, because SetPlayerPos takes some time to set the pos of the player.
That's why GetPlayerPos will get in your case the pos BEFORE SetPlayerPos was executed completely.
Re: Setting Player Pos -
MadeMan - 06.08.2011
pawn Код:
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SaveMyPos[playerid][x] = X;
SaveMyPos[playerid][y] = Y;
SaveMyPos[playerid][z] = Z;
SetPlayerPos(playerid,2531.3379,-1665.7101,15.1674);
SetPlayerFacingAngle(playerid,91.2278);
Order is important.