Per T146873 and T148592, it is currently impossible for scripts to append/write to the ban.txt file. This limits the ability for server administrators to perform their responsibilities, as it means that the admins must have separate access to the host's filesystem in order to manage player bans. Server owners may not want to provide their admins with direct access to the server filesystem and would prefer that their admins manage bans inside the game via admin tool mods, like Community-Online-Tools or VPPAdminTools, etc.
I propose that a new native function be added to the game, called AddBan, which can be called to append new ban lines to the ban.txt file.
proto native void AddBan(string id, string comment);
Example usage:
AddBan("csQcmQ2TcCSQIiMsngK1wUmGC8yCtszKf19EMfUwAiw=", "Used racial slurs in VOIP on 2022-08-13");
The resulting line appended to the ban.txt file:
csQcmQ2TcCSQIiMsngK1wUmGC8yCtszKf19EMfUwAiw= //Used racial slurs in VOIP on 2022-08-13