PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <regsysnat>
#define NAME "Weekly question"
#define VERSION "1.0"
#define AUTHOR "Marius"
new file1[64];
public plugin_init()
{
register_plugin(NAME, VERSION, AUTHOR);
exec_files();
}
public exec_files()
{
get_configsdir(file1, 63);
add(file1, sizeof(file1) - 1, "/qofw/questions.ini");
if(!file_exists(file1))
{
log_to_file("Questions.log", "%s nu exista", file1);
return PLUGIN_HANDLED
}
return 1
}
public rs_logged_in(id)
{
new name[64], text[64], j = 0;
get_user_name(id, name, charsmax(name));
new fHandle = fopen(file1, "wt")
formatex(text, charsmax(text), "%s fputs", name)
fputs(fHandle, text)
write_file (file1, "write_file", 3)
fprintf(fHandle, "%s frpint", name);
fclose(fHandle)
}
All of this three methods are working with this test plugin... wich of them should I use and what should I modify to my plugin?
" I'm surprised you are not getting run-time errors for this."
I'm getting run-time errors
Code:
L 06/18/2014 - 09:22:00: [AMXX] Displaying debug trace (plugin "qofweek.amxx")
L 06/18/2014 - 09:22:00: [AMXX] Run time error 11: divide
L 06/18/2014 - 09:22:00: [AMXX] [0] qofweek.sma::write_info (line 141)
L 06/18/2014 - 09:22:00: [AMXX] [1] qofweek.sma::menu_handler (line 266)
I suppose that this errors appear because this plugin have nothing to read from file.