ID:156030
 
admin
verb
ban()
var/list/players = list()
for(var/mob/m in world)
if(m.client) players += m.ckey
var/ban_name = input("Who will be banned?","Ban") in players+">cancel<"
if(ban_name == ">cancel<") return
var/reason = input("For what reason is [ban_name] banned?","Ban") as text
var/savefile/ban_log = new("bans/[ban_name].sav")
ban_log["ckey"] << ban_name
ban_log["reason"] << reason
ban_log["banner"] << usr.ckey
ban_log["date"] << time2text(world.realtime)
src << "The ban for \"[ban_name]\" has been filed."
unban()
client/New()
var/ban_path = "bans/[ckey].sav"
if(length(file(ban_path)))
var/savefile/ban_log = new(ban_path)
var/ban_reason
var/ban_banner
var/ban_date
ban_log["reason"] >> ban_reason
ban_log["banner"] >> ban_banner
ban_log["date"] >> ban_date
src << "You are banned from this server and are no longer allowed to play in it.<br>The ban was filed in [ban_date], by [ban_banner].<br>You are banned for the following reason: \"[ban_reason].\""
del src
..()

In the ban() verb, I choose who to ban from a list() of ckeys acquired from mobs in world.
How would I work on an unban() verb that allowed me to choose who to unban by making a list of the savefiles in the /bans folder?

You can use the flist() proc to return a list of savefiles in a directory, like so:

var/list/savefiles=flist("savefiles/")