[SOLVED] doesn'n write to file
#1

Well, here is my code:
pawn Код:
sset(filename[], string[])
{
    if(!fexist(filename)) return 0;
    new File:newfile = fopen(filename, io_append);
    fwrite(newfile, string);
    fclose(newfile);
    return 1;
}
I tried: sset("file.txt", " fome text\r\n"); , but text in file doesn't show, file absolutely empty. Why?
Reply
#2

This code should be working. Maybe there is something else wrong in your script.
Reply
#3

U have created this file in scriptfiles?
just delete
Код:
if(!fexist(filename)) return 0;
Код:
sset(filename[], string[])
{
	new File:newfile = fopen(filename, io_append);
	new str[256];
	format(str, sizeof(str), "%s\r\n",string);
	fwrite(newfile, str);
	fclose(newfile);
	return 1;
}
Reply
#4

hm, interesting, but I've changed file saving name, and it works. Thanks for help anyway.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)