Raised This Month: $ Target: $400
 0% 

fputs() problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 12-20-2009 , 17:12   fputs() problem
Reply With Quote #1

When I use fputs() I can only save 1 line in a .ini or .cfg file.

Im using it like this

Code:
public do_savecmd(id,szNewcmd[],szOldcmd[], szType[])
{
    new iFile = fopen(Path, "w");
    if( !iFile )
        return;
    
    new const szData[100];
    format(szData,sizeof(szData)-1, "^"%s^" ^"%s^" ^"%s^"",szNewcmd,szOldcmd, szType)
    
    fputs(iFile, szData);
    fclose(iFile);
    
    console_print(id, "New Command : %s",szNewcmd)
    console_print(id, "Old Command : %s",szOldcmd)
    console_print(id, "Type : %s", szType)
}
So when I put something in the file, it goes in there. but when I want to put something new in it. It deletes the first line and puts in the new.
__________________
I am out of order!
grimvh2 is offline
 



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

Forum Jump


All times are GMT -4. The time now is 04:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode