Arrume conforme seu gm!
pawn Code:
TitoInfo::SalvarPlayer(playerid)
{
new file[40];
GetPlayerName(playerid, Name, sizeof(Name));
format(file, sizeof(file), "Contas/%s.ini", Name);
if(!DOF2_FileExists(file)) DOF2_CreateFile(file);
GetPlayerPos(playerid, PlayerInfo[playerid][PosX], PlayerInfo[playerid][PosY], PlayerInfo[playerid][PosZ]);
DOF2_SetFloat(file, "PosX", PlayerInfo[playerid][PosX]);
DOF2_SetFloat(file, "PosY", PlayerInfo[playerid][PosY]);
DOF2_SetFloat(file, "PosZ", PlayerInfo[playerid][PosZ]);
DOF2_SetFloat(file, "InteriorID", GetPlayerInterior(playerid));
DOF2_SaveFile();
return 1;
}
public OnPlayerSpawn(playerid)
{
new file[60];
GetPlayerName(playerid, Name,sizeof(Name));
format(file, sizeof(file), "Contas/%s.ini", Name);
PlayerInfo[playerid][PosX] = DOF2_GetFloat(file, "PosX");
PlayerInfo[playerid][PosY] = DOF2_GetFloat(file, "PosY");
PlayerInfo[playerid][PosZ] = DOF2_GetFloat(file, "PosZ");
SetPlayerInterior(playerid, PlayerInfo[playerid][pInterior]);
SetPlayerPos(playerid, PlayerInfo[playerid][PosX], PlayerInfo[playerid][PosY], PlayerInfo[playerid][PosZ]);
return 1;
}