Also Ich Habe Das Problem Wenn Einer neu rein kommt und er noch Kein Spawn.inc hat. Dann Er Wird bei 0,0. 0,0. 0,0 Geportet. Wie Kann Ich Das Machen er in 681.3826,-473.9918,16.5363 Geportet wird ?
Hier Wie Ich Das Gemacht Habe
public OnPlayerDisconnect(playerid, reason){
new file[128], pname[MAX_PLAYER_NAME];
new Float:x, Float:y, Float:z;
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\SavePos\\%s.ini", pname);
if(!dini_Exists(file))
dini_Create(file);
GetPlayerPos(playerid, x, y, z);
dini_FloatSet(file, "posX", x);
dini_FloatSet(file, "posY", y);
dini_FloatSet(file, "posZ", z);
return 1;
}
public OnPlayerSpawn(playerid)
{
new file[128], pname[MAX_PLAYER_NAME];
new Float:x, Float:y, Float:z;
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\SavePos\\%s.ini", pname);
x = dini_Float(file, "posX");
y = dini_Float(file, "posY");
z = dini_Float(file, "posZ");
SetPlayerPos(playerid, x, y, z);
return 1; }
new file[128], pname[MAX_PLAYER_NAME];
new Float:x, Float:y, Float:z;
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\SavePos\\%s.ini", pname);
if(!dini_Exists(file))
dini_Create(file);
GetPlayerPos(playerid, x, y, z);
dini_FloatSet(file, "posX", x);
dini_FloatSet(file, "posY", y);
dini_FloatSet(file, "posZ", z);
return 1;
}
public OnPlayerSpawn(playerid)
{
new file[128], pname[MAX_PLAYER_NAME];
new Float:x, Float:y, Float:z;
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\SavePos\\%s.ini", pname);
x = dini_Float(file, "posX");
y = dini_Float(file, "posY");
z = dini_Float(file, "posZ");
SetPlayerPos(playerid, x, y, z);
return 1; }