30.12.2011, 22:54
Save the player's position like this:
pawn Код:
new
Float: gLastPos[MAX_PLAYERS][3];
//When you use the command:
CMD:port(playerid,params[])
{
#pragma unused params
GetPlayerPos(playerid, gLastPos[playerid][0], gLastPos[playerid][1], gLastPos[playerid][2]); // Save the coordinates of his position
SetPlayerPos(playerid,2048.9729,-1908.4037,13.5469);
return true;
}
// Return him back to his old location:
CMD:portback(playerid,params[])
{
#pragma unused params
//How do I return to the coordinates where it was when he type / port
SetPlayerPos(playerid, gLastPos[playerid][0], gLastPos[playerid][1], gLastPos[playerid][2]);
return true;
}