Hello,
I made that plugin which gets the names from a file 'file1.ini' and check if they are on another file 'file2.ini', and if the second argument in the line which the name is found (on file2) is 0 then delete that line in the file1. But, it didn't work! Can someone see where is the problem?
PHP Code:
#include <amxmodx>
#include <amxmisc>
public plugin_init()
{
register_plugin("File Cleaner", "1.0", "~D4rkSiD3Rs~");
CleanFile();
}
public CleanFile()
{
/* File 1 */
new configdir[200];
get_configsdir(configdir, 199);
format(configdir, 199, "%s/file1.ini", configdir);
new line = 0;
new linetextlength = 0;
new linetext[512]
new name[32], option[32];
/* ****** */
/* File 2 */
new configdir2[200];
get_configsdir(configdir2, 199);
format(configdir2, 199, "%s/file2.ini", configdir2);
new line2 = 0;
new linetextlength2 = 0;
new linetext2[512]
new name2[32];
/* ****** */
while(read_file(configdir, line++, linetext, charsmax(linetext), linetextlength))
{
parse(linetext, name, charsmax(name), option, charsmax(option));
while(read_file(configdir2, line2++, linetext2, charsmax(linetext2), linetextlength2))
{
parse(linetext2, name2, charsmax(name2));
if( equali(name2, name) && equali(option, "0") )
{
formatex(linetext, charsmax(linetext), "");
write_file(configdir, linetext, line - 1);
}
}
}
}
__________________