SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 20/06/2013, 08:09 AM   #1
pasha97
Gangsta
 
pasha97's Avatar
 
Join Date: Feb 2012
Location: Voronezh,Russia
Posts: 651
Reputation: 60
Default fwrite writes only 1 line

To be honest, i have never used fwrite, I always used dini. But now I need to use it. And what I see: Every time we write anything to the file, new line replaces all the previous file content

pawn Code:
format(stringu,sizeof(stringu),"%s/%s/%f/%f/%f/%d\r\n",name,pname,x,y,z,world);
if(buildingsFile)
{
fwrite(buildingsFile,stringu);
.............

So fwrite doesnt write the string to the next line. It erases the file, and then writes the string to it.
__________________
pasha97 is offline   Reply With Quote
Old 20/06/2013, 08:14 AM   #2
BigETI
Banned
 
Join Date: Mar 2010
Location: Germany
Posts: 1,046
Reputation: 359
Default AW: fwrite writes only 1 line

Please show me how do you open your file.
BigETI is offline   Reply With Quote
Old 20/06/2013, 08:14 AM   #3
IceBilizard
Gangsta
 
Join Date: Feb 2012
Posts: 869
Reputation: 47
Default Re: fwrite writes only 1 line

io_write writes every time new line from top so if you need to write more then one line use

io_append

You can visit here and see file functions
http://wiki.sa-mp.com/wiki/File_Functions
IceBilizard is offline   Reply With Quote
Old 20/06/2013, 08:25 AM   #4
SwisherSweet
Huge Clucker
 
SwisherSweet's Avatar
 
Join Date: Sep 2012
Location: Insideurmom
Posts: 492
Reputation: 68
Default Re: fwrite writes only 1 line

[code]
format(stringu,sizeof(stringu),"%s %s %f %f %f %d\r\n",name,pname,x,y,z,world);
[/code
__________________
retired owner of 2 servers...
SwisherSweet is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
fWrite / Top Line Glad2BeHere Scripting Help 4 17/06/2013 04:08 AM
[PLS HELP]ini writers desn't writes or reads! Nexotronix Help Archive 6 12/04/2011 05:01 PM
[Tuts4Nubs]I wants a cig in ma hand when I writes /smoke!!! Thrarod Help Archive 4 08/04/2010 03:45 PM
when i edit from my friends gta san andreas server it writes to the script wrong teamsheetz Server Support 1 02/07/2009 07:27 PM
[SOLVED] /admins problem - writes about 10-15 lines Castle Help Archive 12 21/05/2009 08:52 AM


All times are GMT. The time now is 03:25 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.