Save GetPlayerPos ? - 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: Save GetPlayerPos ? (
/showthread.php?tid=228151)
Save GetPlayerPos ? -
marinov - 19.02.2011
I'm working on a RCXD for my TDM server, I need to save the position where the player uses the cmd (to use the RCXD) to after blowing it, will set the player back to that pos. How to do that ?
Re: Save GetPlayerPos ? -
Backwardsman97 - 19.02.2011
You can use PVars or just regular arrays.
Here's an example with PVars.
pawn Код:
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
SetPVarFloat(playerid,"X",x);
SetPVarFloat(playerid,"Y",y);
SetPVarFloat(playerid,"Z",z);
And then when you set the position.
pawn Код:
SetPlayerPos(playerid,GetPVarFloat(playerid,"X"),GetPVarFloat(playerid,"Y"),GetPVarFloat(playerid,"Z"));
Re: Save GetPlayerPos ? - [L3th4l] - 19.02.2011
You can globally use variables, or use PVars ( Yes, they are slower, but they do the work
)
pawn Код:
new
Float:pPos[3];
GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]); // When using the RCXD
-----
SetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]); // When the RCXD blows up
Re: Save GetPlayerPos ? -
marinov - 19.02.2011
It looks like what I need, let me try and I let I post if it works
EDIT: Just what I needed, thanks man (you both
)