ID:1340143
 
(See the best response by Danny Roe.)
mob/admin/verb/ban(mob/m in world)
set category="Admin"
m.banned=1
var/savefile/F=new("Players/[ckey(m.key)].sav")
F["Banned"]<<m.banned
del m
world << "[m] has been banned."


login()
var/FileName="Players/[ckey(src.key)].sav"
if(fexists(FileName))
var/savefile/F=new(FileName)
F["Banned"]>>src.banned
if(src.banned)
alert("You are banned")
del src


Problem description: So I know how to ban someone using the above code but how can I possibly unban someone if they are not in the world because they're banned? I could create a world list but how do I save a world list?
You could set up a list in your world to which you can add names to unban, and then if someone logs in who is banned, it will check the list to see if they should be unbanned (and do so) before/instead of kicking them out.

Obviously, unless you hard-code this list in (which means a game update every time you want to unban someone), you'll have to add names to it at run-time, which means that it'll only work if the banned player tries to log in while that particular game session/server is running.

Alternatively, you could have bans only be semi-permanent, and "expire" after a certain number of days/weeks. To do this, you could set their "banned" var to world.realtime (instead of just 1), then on login, you could check the value against the current realtime to see how long ago they were first banned. If it is past your time limit, then unban them. (you'd need to do the math on the realtime difference to figure out how many days/weeks/whatever it has been)
Best response
How to save a world list.

Using a world list to store the banned keys is the ideal way to go. Doing this, you can simply remove a key from it at any time you like to unban someone.

Also don't forget to add the ..() at the end of World/New() and World/Del() as it has been left out of the code snippit in the link.
Just want to point out that you're deleting m and then referencing it in an output after. You'll get a null value for m there because of it.