AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Write & Read Config File. (https://forums.alliedmods.net/showthread.php?t=162961)

Paulster1022 07-25-2011 03:21

Write & Read Config File.
 
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.

liinuus 07-25-2011 03:33

Re: Write & Read Config File.
 
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

drekes 07-25-2011 03:49

Re: Write & Read Config File.
 
There's a tutorial about reading / writing files in the code snippets section.

fysiks 07-25-2011 07:03

Re: Write & Read Config File.
 
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.


All times are GMT -4. The time now is 00:48.

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