new STG[64], PegarIP[16];
GetPlayerIp(playerid, PegarIP, 16);
format(STG, 64, "InfoJogadores/IPs/%s.ini", PegarIP);
if(!DOF2_FileExists(STG))
{
DOF2_CreateFile(STG);
DOF2_SetString(STG, "Conta", Nome_Conta(playerid));
DOF2_SaveFile();
}
else if(!DOF2_FileExists(DOF2_GetString(String, "Conta1")))
{
DOF2_SetString(STG, "Conta1", Nome_Conta(playerid));
DOF2_SaveFile();
}
else if(!DOF2_FileExists(DOF2_GetString(String, "Conta2")))
{
DOF2_SetString(STG, "Conta2", Nome_Conta(playerid));
DOF2_SaveFile();
}
else if(!DOF2_FileExists(DOF2_GetString(String, "Conta3")))
{
DOF2_SetString(STG, "Conta3", Nome_Conta(playerid));
DOF2_SaveFile();
}
Use a nativa do SA-MP.
https://sampwiki.blast.hk/wiki/File_Functions. |
Os exemplos estгo lб.
Com DOF2 vai ser um pouco mais complicado... |
new STG[64], PegarIP[16];
GetPlayerIp(playerid, PegarIP, 16);
format(STG, 64, "InfoJogadores/IPs/%s.ini", PegarIP);
if(!DOF2_FileExists(STG))
{
DOF2_CreateFile(STG);
DOF2_SetString(STG, "Conta", Nome_Conta(playerid));
DOF2_SaveFile();
}
else
{
DOF2_SetString(STG, "Conta1", Nome_Conta(playerid));
DOF2_SaveFile();
}
Use a nativa do SA-MP.
https://sampwiki.blast.hk/wiki/File_Functions. |
Se estudares em vez de andares a procura que te faзam o trabalho na mao, tambem se torna simples pra vc.
|
new STG[64], PegarIP[16], string[64];
new File:Nconta = fopen("InfoJogadores/IPs/%s.ini", io_read);
GetPlayerIp(playerid, PegarIP, 16);
format(STG, 64, "InfoJogadores/IPs/%s.ini", PegarIP);
if(!DOF2_FileExists(STG))
{
DOF2_CreateFile(STG);
DOF2_SetString(STG, "Conta", Nome_Conta(playerid));
DOF2_SaveFile();
}
else if(Nconta)
{
while(fread(Nconta, string))
{
if(strfind(string, "conta1") != -1)
{
DOF2_CreateFile(STG);
DOF2_SetString(STG, "Conta1", Nome_Conta(playerid));
break;
}
else if(strfind(string, "Conta2") != -1)
{
DOF2_CreateFile(STG);
DOF2_SetString(STG, "Conta2", Nome_Conta(playerid));
break;
}
else if(strfind(string, "Conta3") != -1)
{
DOF2_CreateFile(STG);
DOF2_SetString(STG, "Conta3", Nome_Conta(playerid));
break;
}
}
}