05.02.2011, 19:11
You can write his coordinates to file using something like dini or what ever you like.
Than when he logs back you just put him back to his last position.
EDIT: Damn, Mean is quick!!
EDIT2: @Mean - You should save X, Y and Z as a float. And read it as a float.
Right code would look something like this: (just edited it quickly, and haven't tested it since I don't have SA installed)
Than when he logs back you just put him back to his last position.
EDIT: Damn, Mean is quick!!

EDIT2: @Mean - You should save X, Y and Z as a float. And read it as a float.
Right code would look something like this: (just edited it quickly, and haven't tested it since I don't have SA installed)
pawn Код:
CMD:savemypos(playerid, params[])
{
new file[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), "%s.txt", name);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
dini_FloatSet(file, "LastXPos", x);
dini_FloatSet(file, "LastYPos", y);
dini_FloatSet(file, "LastZPos", z);
return 1;
}
public OnPlayerSpawn(playerid)
{
new file[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), "%s.txt", name);
SetPlayerPos(playerid, dini_Float(file, "LastXPos"), dini_Float(file, "LastYPos"), dini_Float(file, "LastZPos"));
return 1;
}