04.04.2016, 14:19
(
Последний раз редактировалось ReD_HunTeR; 03.10.2018 в 10:29.
)
EDIT: Solved
[16:06:31] [debug] #0 native fclose () from sampsvr-port_7788
I'd say it's crashing when you're using fclose somewhere in your script.
|
stock dini_Create(filename[])
{
if (fexist(filename)) return false;
new File: fhnd = fopen(filename, io_write);
if (!fhnd) return false;
return fclose(fhnd);
}
stock AppendTo(filename[], string[])
{
new File: myfile = fopen(filename, io_append);
if (myfile)
{
new timestring[MAX_STRING];
if (strcmp(filename, "phones.ini", true) == 0)
{
format(timestring, sizeof(timestring), "%s", string);
fwrite(myfile, timestring);
return fclose(myfile);
}
else if (strcmp(filename, "commands.log", true) == 0)
{
format(timestring, sizeof(timestring), "%s\n", string);
fwrite(myfile, timestring);
return fclose(myfile);
}
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);
return fclose(myfile);
}
return 0;
}