[SOLVED] doesn'n write to file - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [SOLVED] doesn'n write to file (
/showthread.php?tid=88435)
[SOLVED] doesn'n write to file -
arnutisz - 26.07.2009
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?
Re: [HELP] doesn'n write to file -
MadeMan - 26.07.2009
This code should be working. Maybe there is something else wrong in your script.
Re: [HELP] doesn'n write to file -
Jefff - 26.07.2009
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;
}
Re: [HELP] doesn'n write to file -
arnutisz - 26.07.2009
hm, interesting, but I've changed file saving name, and it works. Thanks for help anyway.