21.12.2018, 01:02
Bom, usei DOF2 como exemplo pois nгo tenho DINI, tente adapta ai, qualquer coisa avise aqui se nгo conseguir.
PHP код:
#define ORG_FILE "Orgs/org%d.ini"
// usei pra criar as file...
Orgs(){
new str[12], file[64];
for(new i = 0; i < 12/*maxorg*/; i++){
format(file, sizeof(file), ORG_FILE, i);
DOF2_CreateFile(file);
DOF2_SetString(file, "Lider", "Nenhum");
DOF2_SetInt(file, "ID", i);
for(new x = 0; x < 12; x++){
format(str, 128, "Membro%d", x);
DOF2_SetString(file, str, "Nenhum");
}
DOF2_SaveFile();
}
return 1;
}
// vai deletar a org e reajustar outra...
DestroyOrg(orgid){
new file[64], filen[64];
format(file, sizeof(file), ORG_FILE, orgid);
if(DOF2_FileExists(file)){
DOF2_RemoveFile(file);
}
for(new i = 0; i < 12; i++){
format(file, sizeof(file), ORG_FILE, i);
if(DOF2_FileExists(file)) continue;
format(file, sizeof(file), ORG_FILE, i+1);
if(DOF2_FileExists(file)){
format(filen, sizeof(filen), ORG_FILE, i);
DOF2_RenameFile(file, filen);
}
}
return 1;
}