05.02.2011, 18:20
Hi, how to do such a thing as that, when a player logs on the server, and when he logs on the server, it will spawn back there where he wrote the
CMD:savemypos(playerid, params[]) {
new file[256];
new name[24];
GetPlayerName(playerid, name, 24);
format(file, 256, "%s.txt");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
dini_IntSet(file, "LastXPos", x);
dini_IntSet(file, "LastYPos", y);
dini_IntSet(file, "LastZPos", z);
return 1;
}
public OnPlayerSpawn(playerid) {
new file[256];
new name[24];
GetPlayerName(playerid, name, 24);
format(file, 256, "%s.txt", name);
SetPlayerPos(playerid, dini_Int(file, "LastXPos"), dini_Int(file, "LastYPos"), dini_Int(file, "LastZPos));
return 1;
}
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;
}
C:\Users\Janek\Desktop\Avolotion RolePlay\gamemodes\Avolotion.pwn(4207) : error 017: undefined symbol "dini_Float"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
SetPlayerPos(playerid, dini_Float(file, "LastXPos"), dini_Float(file, "LastYPos"), dini_Float(file, "LastZPos"));