[REQ] Read arguments from .ini file
Hello everyone,
Can anyone make a litle tutorial or just example plugin who read arguments from ini file and from specific line of thet file. Example, I have .ini file and I want to plugin read line 8. On line 8 are two arguments: "BaD CopY" "1000" (First argument is betwen first and second quotes and second argument is betwen third and fourth quotes). So, plugin must give golds. First argument is nick of player and second argument is number of player's golds. Plugin must set golds like second argument from .ini file to player (first argument) Plugin will create file: golds.ini and in thet file is nick of all players who connected to the server and who have min. 1 kill (gold) This is a part of gold system plugin PHP Code:
|
Re: [REQ] Read arguments from .ini file
It's simple. Read the file like normal (using fopen, fgets, fclose). Simply use parse() on the data you get from fgets() to extract those two values. Do what ever you need to do to know if it's the line you want (referencing by line is a bad idea).
|
| All times are GMT -4. The time now is 20:14. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.