Save GetPlayerPos ?
#1

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 ?
Reply
#2

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"));
Reply
#3

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
Reply
#4

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 )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)