08.07.2017, 05:49
(
Последний раз редактировалось MrAjusshi; 08.07.2017 в 06:35.
)
I have this error "#0 native fclose () from samp03svr" from crashdetect on my server log.
I am not quite sure what is the problem here.. I've search for this problem and find similar problem to my problem but didn't work very well so I think, I should start new thread.
Edit:
It work very well with windows (.dll plugins) but not with Linux (.so plugins even though all plugins work very well and loaded as well)
Edit: Fixed
I am not quite sure what is the problem here.. I've search for this problem and find similar problem to my problem but didn't work very well so I think, I should start new thread.
pawn Код:
stock AppendTo(filename[],string[])
{
if(!fexist(filename))
{
new File:myfile=fopen(filename,io_write);
fclose(myfile);
}
new File:myfile=fopen(filename,io_append);
new timestring[MAX_STRING];
if(strcmp(filename,"phones.ini",true)==0)
{
format(timestring,sizeof(timestring),"%s",string);
fwrite(myfile,timestring);
fclose(myfile);
return 1;
}
if(strcmp(filename,"commands.log",true)==0)
{
format(timestring,sizeof(timestring),"%s\n",string);
fwrite(myfile,timestring);
fclose(myfile);
return 1;
}
new hour,minu,seco,giorno,mese,anno;
gettime(hour,minu,seco); getdate(anno,mese,giorno);
format(timestring,sizeof(timestring),"[%d:%d:%d/%d-%d-%d]%s\n",hour,minu,seco,giorno,mese,anno,string);
fwrite(myfile,timestring);
fclose(myfile);
return 1;
}
pawn Код:
stock Debug(string[])
{
SendClientMessageToAdmins(string,COLOR_GREEN);
print(string);
new newstring[MAX_STRING]; format(newstring,sizeof(newstring),"%s\n",string);
if(!fexist(debuglog))
{
new File:myfile=fopen(debuglog,io_write);
fwrite(myfile,newstring);
fclose(myfile);
}
new File:myfile=fopen(debuglog,io_append);
fwrite(myfile,newstring);
fclose(myfile);
return 1;
}
It work very well with windows (.dll plugins) but not with Linux (.so plugins even though all plugins work very well and loaded as well)
Edit: Fixed