hello, i want to make log stock. i Tried make this but this doesnt work

help pls
PHP Code:
new const g_constLogDirectory[] = "addons/amxmodx/data/lol/log.txt";
public plugin_init()
{
lolfile_log(g_constLogDirectory,"HLDS Start....");
}
public lolfile_log( const file[], const log[] )
{
new file_index = fopen(g_constLogDirectory,"a+");
new log_text[128],log_time[16];
get_time("%m/%d/%Y - %H:%M:%S",log_time,sizeof(log_time) - 1);
formatex(log_text,sizeof(log_text) - 1,"%s : %s^n",log_time,log);
fputs(file_index,log_text);
fclose(file_index);
return 0;
}