Fiz brincando com DOF2 aqui um exemplo.
pawn Код:
#include <a_samp>
#include <Double-o-Files_2>
new iFiles[7][MAX_PLAYER_NAME] = {
{"joгo_paulo.ini"},
{"leandro_neni.ini"},
{"Fulano_baitola.ini"},
{"Forum-samp.ini"},
{"macum bAA.ini"},
{"testt_e.ini"},
{"Ronaldo pereba.ini"}
},l_szName[15],g_szString[128];
stock static iNames[7][MAX_PLAYER_NAME] = {
{"joгo_paulo"},
{"leandro_neni"},
{"Fulano_baitola"},
{"Forum-samp"},
{"macum bAA"},
{"testt_e"},
{"Ronaldo pereba"}
};
public OnFilterScriptInit(){
print("FS: Top Players loaded");
//CreateAccounts_SET();
GetAllNamesVIP();
return 1;
}
public OnFilterScriptExit(){
print("-------------");
DOF2::Exit();
return 1;
}
GetAllNamesVIP(){
for(new i; i < 6; i++)
{
if (!strcmp(DOF2::GetString(iFiles[i], "VIP"), "gold", true))
printf("%d - Player:%s\nVIP-Gold:%s", i, iNames[i], DOF2::GetString(iFiles[i], "VIP"));
}
}
CreateAccounts_SET(){
DOF2::CreateFile("nicknames.ini");
for(new i; i < 6; i++)
{
DOF2::CreateFile(iFiles[i]);
DOF2::SetString(iFiles[i], "Nome", iFiles[i]);
DOF2::SetString(iFiles[i], "VIP", "gold");
format(g_szString, 128, "Registro_%d", i);
DOF2::SetString("nicknames.ini", g_szString, iFiles[i]);
}
DOF2::SaveFile();
}
Pra testar vocк precisa descomentar a chamada
CreateAccounts_SET(); e em seguida abrir o server, depois precisa comentar a linha
CreateAccounts_SET(); novamente e compilar, ai pode testar e ver o resultado.