Raised This Month: $ Target: $400
 0% 

Write & Read Config File.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Paulster1022
Member
Join Date: Apr 2006
Old 07-25-2011 , 03:21   Write & Read Config File.
Reply With Quote #1

Any tutorials on how to write and read to a config file? I am basically trying to get the origin of a player and write it in a file. Then of course read the information back. I looked at other plugins such as "Capture The Flag"(ghw's plugin), but had no luck on understanding fully. If anyone could help me out, would be much appreciated thank you.
Paulster1022 is offline
Send a message via AIM to Paulster1022
liinuus
Senior Member
Join Date: Apr 2010
Old 07-25-2011 , 03:33   Re: Write & Read Config File.
Reply With Quote #2

use write_file and read_file.
for the read file you can make an loop of the files size and read line by line, for write_file you can use -1 for the line wich will put what u add in a new line

Last edited by liinuus; 07-25-2011 at 03:35.
liinuus is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 07-25-2011 , 03:49   Re: Write & Read Config File.
Reply With Quote #3

There's a tutorial about reading / writing files in the code snippets section.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-25-2011 , 07:03   Re: Write & Read Config File.
Reply With Quote #4

I would recommend not trying to learn the write_file() and read_file() natives and just learn the more efficient ones like fopen(), fgets(), fputs(), etc.

And, remember that a config file is just a text file.
__________________
fysiks is offline
Reply



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 00:48.


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