#include <a_samp>
#include <zCMD>
#include <DOF2>
CMD:savepos(playerid)
{
new Float:pos[4], str[128], arquivo[128], nome[24];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
GetPlayerFacingAngle(playerid, pos[3]);
format(str, sizeof(str), "Posicao atual: X: %f Y: %f Z: %f A: %f Interior: %d", pos[0], pos[1], pos[2], pos[3], GetPlayerInterior(playerid));
SendClientMessage(playerid, 0xFFFF00FF, str);
SendClientMessage(playerid, 0x00FF00FF, "Posicao salva em ScriptFiles.");
GetPlayerName(playerid, nome, sizeof(nome));
format(arquivo, sizeof(arquivo), "SavePos-%s.ini", nome);
if(!DOF2_FileExists(arquivo))
{
DOF2_CreateFile(arquivo);
}
DOF2_SetFloat(arquivo, "Pos X", pos[0]);
DOF2_SetFloat(arquivo, "Pos Y", pos[1]);
DOF2_SetFloat(arquivo, "Pos Z", pos[2]);
DOF2_SetFloat(arquivo, "Pos A", pos[3]);
DOF2_SetInt(arquivo, "Interior", GetPlayerInterior(playerid));
DOF2_SaveFile();
return 1;
}