ID:146755
 
Code:
mob/admin/verb
ban(mob/M as mob in world)
set category = "GM"
set desc="(player) Ban a player"
if (alert(src,"Do you really want to ban [M]?","Really ban?","Ban","Cancel")=="Ban")
var/Z=input("Reason for banning. Fill this out or you can get in trouble for GM abuse.") as text
file("log.txt") << "[usr] has banned [M] for [Z]"
var/N=ckey(M.key)+" "+M.client.address
file("banlist.txt") << "[N]"
M.Saver()
del(M)
unban(key as text)
set category = "GM"
var/banlist=file2text("banlist.txt")
var/p = findtext(key,banlist)
if(p)
banlist = copytext(banlist,1,p) + copytext(banlist,p+length(banlist))
file("banlist.txt") << "[banlist]"
set desc="(key) Unban the specified key"
file("log.txt") << "[usr] has unbanned [key]"


Problem description:
Ban is working fine. Unban isn't though. I can manually unban them but that is hard if I'm AFK for my GMs to do. I'm trying to write my own ban system that can be editted easily. I hope someone can figure out why unban won't delete their entry from banlist.txt...
If you just make a savefile and use a list I bet it would be much much easier. I think it'll be much shorter, too.

Ask if you need help with this.

-Angel 0=)
In response to Angel of Flames
No, you see, the point of this system is that I can easily edit it since it's just a text file. Save files = pain in the ass if they get bugged. I've been using one of those (Crispy's fullban) and there are random bugs like this one certain person being banned every reboot. o.o