[H3LP] Get specific ini line and remove it
Hello. Can anyone show me an example of how I can get a specific line using the new file system? I mean, I am working myself on a brand new and different ban plug-in, and I want when I say max_unban argument1 to look for the line containing argument1 and remove the whole text from it. Thanks !
|
Re: [H3LP] Get specific ini line and remove it
Lol, I'm doing the exact same thing at the moment.
You can't just find a line and delete it. You need to delete the entire file and rewrite it. So store all bans in an array, delete the file, and check whether the ban is in the array when writing it again. |
Re: [H3LP] Get specific ini line and remove it
Re-write all lines to another temp file excluding the line, that contains the unbanned player, which you want to remove and then delete the original file and rename the temp file. I have done the same thing a month ago. Lol
|
Re: [H3LP] Get specific ini line and remove it
Quote:
|
Re: [H3LP] Get specific ini line and remove it
|
Re: [H3LP] Get specific ini line and remove it
Quote:
|
Re: [H3LP] Get specific ini line and remove it
If you have your bans saved in an array, you don't need to rename it. Delete it directly and rewrite it.
|
Re: [H3LP] Get specific ini line and remove it
Problem solved, ty guys :)
|
| All times are GMT -4. The time now is 17:56. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.