File writing - 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)
+--- Thread: File writing (
/showthread.php?tid=394254)
File writing -
thefatshizms - 21.11.2012
Ok, i have decided to go through wiki and 're-learn' everything in there and also read the pdf's on compuphase in order to get a better understanding on the pawn language. I have found a problem, after doing about files it seems i cant write a new line for example:
It will simply put line 1 and never line 2. I have put \r\n (new line) and yet it does not write a new line, is there anything I'm doing wrong?
pawn Код:
if (strcmp("/file", cmdtext, true, 10) == 0)
{
new File:file=fopen("test.txt", io_write);
if(file)
{
fwrite(file, "This text has been written to the file\r\n");
fclose(file);
}
return 1;
}
AW: File writing -
Skimmer - 21.11.2012
Removes all text in your
test.txt File and writes a new text. You may use,
instead of
io_write
Quote:
io_write Write in the file, or create the file. Erases all contents.
io_append Appends (adds) to file, write-only. If the file does not exist, it is created
|
Re: AW: File writing -
thefatshizms - 21.11.2012
Quote:
Originally Posted by MouseBreaker
Removes all text in your test.txt File and writes a new text. You may use,
instead of io_write
|
I already tried this but will try again.
AW: File writing -
Skimmer - 21.11.2012
@thefatshizms: I already tried this but will try again.
It works fine on my computer.
Re: File writing -
ReneG - 21.11.2012
btw, thefatshizms nothing is wrong with your /file command. You're simply starting a new line but not writing anything afterwards
Re: File writing -
thefatshizms - 21.11.2012
Ok, thanks vincent
I changed it to append and it still didn't work, i then re downloaded the sa-mp package and now its working.
AW: File writing -
Skimmer - 21.11.2012
No thanks for me? /Cry