I was trying to edit some files with the es_tools command est_openfile, but I couldn't make it work, and sometimes it crashed. So well I thought of trying to create my own addon which would be easy to use, and well... wouldn't crash the server. I actually thought it would be harder, but it wasn't.
[b]What it does:[/b]
Edit server files ingame in your console through rcon. Files such as .txt and .cfg can be editted. Add or remove lines, output the whole file in the console with line numbers in the side. Delete, create or copy files.
All you need is rcon access and you're good to go.
[size=14][u][b]Commands:[/b][/u][/size]
openfile - Open a file to edit.
openfile [file]
Example: openfile "cfg\server.cfg"
closefile - Close the opened file, and save the changes made.
closefile
closefilenosave - Close the opened file, without saving the changes made.
closefilenosave
copyfile - Create a copy of a file, without it needing to be open.
copyfile [file] [copy]
Example with same name: copyfile "cfg\server.cfg" "addons\server.cfg"
Example with rename: copyfile "cfg\server.cfg" "addons\old_server.cfg"
movefile - Move a file to another directory. If a file with the same name exist, in the distination, it'll be overwritten.
movefile [source] [distination]
Example with same name: movefile "cfg\server.cfg" "addons\"
Example with rename: movefile "cfg\server.cfg" "addons\old_server.cfg
listdir - Prints the content of the folder provided, into the console. If non provided, lists the content of cstrike.
listdir [dir]
Example: listdir "cfg\"
filesaveas - Saves the currently open file, with a new name.
filesaveas [newfile]
Example: filesaveas "addons\file_saved_as.txt"
deletefile - Deletes an unopened file.
deletefile [file]
Example: deletefile "motd.txt"
fileexists - Checks to see if a file exists.
fileexists [file]
Example: fileexists "cfg\autoexec.cfg"
printopenfile - Print the open file, into the console
printopenfile
readline - Returns the contents of a line in a file (0 being line 1, and so on)
readline [linenumber]
Example: readline 3 (Which is line number 4)
insertline - Insert a line into the opened file (0 being line 1, and so on) -1 for last line.
insertline [linenumber] "text"
Example: insertline 5 "this is line number 6"
deleteline - Removes a line inside of the opened file (0 being line 1, and so on)
deleteline [linenumber]
Example: deleteline 7
countlines - Outputs how many lines, there's inside the opened file
countlines
fm_help - Outputs a list of all filemanager commands, and their syntax.
fm_help
Installation
Extract the .zip file inside your server's cstrike folder, and add "es_load filemanager" to your autoexec, inside the cfg folder.
Or when the addon gets approved, just write "es_install filemanager" in your server console, and add "es_load filemanager" to your autoexec config file.