[Ajuda] Salvar pos ao desconectar - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Salvar pos ao desconectar (
/showthread.php?tid=627967)
Salvar pos ao desconectar -
Luiiiz - 04.02.2017
Fiz um sistema de salvar posiзгo ao desconectar e tб dando 3 warnings (tag mismatch)
Code:
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
new file[50], aname[MAX_PLAYER_NAME], Float:x, Float:y, Float:z;
GetPlayerName(playerid, aname, sizeof(aname));
KillTimer(TimerUp[playerid]);
format(file, sizeof(file), "Contas/%s.ini", aname);
if(DOF2_FileExists(file))
{
GetPlayerPos(playerid, x, y, z);
DOF2_SetInt(file, "Dinheiro", GetPlayerCash(playerid));
DOF2_SetInt(file, "Level", pLevel[playerid]);
DOF2_SetInt(file, "MinUP", minutoup[playerid]);
DOF2_SetInt(file, "SegUP", segundoup[playerid]);
DOF2_SetInt(file, "SairX", x);
DOF2_SetInt(file, "SairY", y);
DOF2_SetInt(file, "SairZ", z);
DOF2_SaveFile();
}
return 1;
}
Ja tentei por Float no DOF2_SetInt mas tambйm nгo consegui
Re: Salvar pos ao desconectar -
FallweN - 04.02.2017
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
new file[50], aname[MAX_PLAYER_NAME], Float:x, Float:y, Float:z;
GetPlayerName(playerid, aname, sizeof(aname));
KillTimer(TimerUp[playerid]);
format(file, sizeof(file), "Contas/%s.ini", aname);
if(DOF2_FileExists(file))
{
GetPlayerPos(playerid, x, y, z);
DOF2_SetInt(file, "Dinheiro", GetPlayerCash(playerid));
DOF2_SetInt(file, "Level", pLevel[playerid]);
DOF2_SetInt(file, "MinUP", minutoup[playerid]);
DOF2_SetInt(file, "SegUP", segundoup[playerid]);
DOF2_SetFloat(file, "SairX", x);
DOF2_SetFloat(file, "SairY", y);
DOF2_SetFloat(file, "SairZ", z);
DOF2_SaveFile();
}
return 1;
}
Coordenadas sгo
float e nгo inteiras, entгo usa-se
DOF2_SetFloat