Raised This Month: $ Target: $400
 0% 

Replacing line in file


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
scrtxxcaz
Senior Member
Join Date: Feb 2007
Location: a place u cant find
Old 05-13-2007 , 02:20   Re: Replacing line in file
Reply With Quote #2

heres an sorta of exmaple alter it to ur needs if it works for you unless some one else knows a better why of doing this.

Code:
 
public somin(id) {
          new a,b,c
          new filepointer = fopen(awpfile,"at+")
          if(filepointer)
          {
                 new readdata[128]
                 new parsed1[32],parsed2[32],parsed3[32]
                 while(fgets(filepointer,readdata,127))
                 {
                            parse(readdata,parsed1,31,parsed2,31,parsed3,31)
                            {
                                           if(contain(parsedauth,"watever") != -1)
                                           {
                                                     a = parsed1
                                                     b = parsed2
                                                     c = parsed3
                                           }
                             }
                   }
           }
           new text[512], line, len
           while ( read_file(file, line++, text, 511, len) ) 
           {
                     if ( contain(text, "whatever") != -1 ) 
                     {
                              new msg[256]
                              format(msg,255,"^"%s^" ^"%s^" ^"%s^" ",a,b,c) //change a,b, or c to the new info
                              replace(text, 511, text, msg)
                              write_file(file, text, line - 1)
                              return PLUGIN_HANDLED
 
                     }
          }
}
__________________
Please leave your name when giving me any karma

Counter Strike Freeze Tag
Status: Testing.... (bugs)

Revised Registration
Status: In Progress

Last edited by scrtxxcaz; 05-13-2007 at 02:25.
scrtxxcaz is offline
Send a message via AIM to scrtxxcaz
 



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 10:38.


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