ID:1887191
 
(See the best response by Ter13.)
Code:
        Key_Ban()
set category = "Admin"
set name = "Ban"
if(usr.lock)
return
var/list/Target = new
for(var/mob/M in world)
if(M.client)
if(M.GM > usr.GM)
usr<<"<b><font size=1><font color = red>You imbecile you cant Ban A GM Ranked Higher then you!"
return
if(M.GM < usr.GM)
Target += M
Target += "Cancel"
var/mob/TargetMob = input("Who would you like to ban?","Ban") in Target
switch(TargetMob)
if("Cancel") return
else
if(TargetMob)
if(TargetMob.key=="Daiguren Hyourinamru")
world<<"<b><font size=1><font color = red>Abuse Info: [usr] tried to ban the owner of game!"
return
var/time=input(usr,"How many days?(Note: 999=perm)","Ban",0) as num
time=round(time)
if(time<1)return
if(time>999) time=999
var/id = "[TargetMob.key]"
var/ip = "[TargetMob.client.address]"
var/kid = "[TargetMob.client.computer_id]"
KeyBans.Add(id)
IPBans.Add(ip)
IDBans.Add(kid)
world<<"<b><font size=1><font color = red>GM Info: [TargetMob.name] has been banned by [usr] for [time] Days."
del(TargetMob.client)
if(TargetMob)
del(TargetMob)


Problem description:

it dosent work..like at all
if(M.GM > usr.GM)
usr<<"<b><font size=1><font color = red>You imbecile you cant Ban A GM Ranked Higher then you!"
return


If any higher ranked "GM" is online, your key ban won't work because of return.

I stopped reading once I got to that part, mostly because it stuck out and because the wall of code bothers me.
In response to Lige
well that part is ment for gms ranked higher then you what i mean is it dosent work on anyone that has a lower gm lvl then you I.E i cant ban normal players
Best response
You have a lot of misplaced logic. Let's dive in:

        Key_Ban()
set category = "Admin"
set name = "Ban"
if(usr.lock)
return
var/list/Target = new
//we don't need to iterate through every mob in the world... That's just silly.
for(var/mob/M in world)
if(M.client)
//You shouldn't be checking this here. The user hasn't tried to ban anybody yet.
if(M.GM > usr.GM)
usr<<"<b><font size=1><font color = red>You imbecile you cant Ban A GM Ranked Higher then you!"
return
//redundant if statements galore!
if(M.GM < usr.GM)
Target += M
//this is unnecessary.
Target += "Cancel"
var/mob/TargetMob = input("Who would you like to ban?","Ban") in Target
//a two statement switch()? Madness!
switch(TargetMob)
if("Cancel") return
else
//wat?
if(TargetMob)
//this should be abstracted.
if(TargetMob.key=="Daiguren Hyourinamru")
world<<"<b><font size=1><font color = red>Abuse Info: [usr] tried to ban the owner of game!"
return
//this won't even compile.
var/time=input(usr,"How many days?(Note: 999=perm)","Ban",0) as num
time=round(time)
//moar wat?
if(time<1)return
//even moar
if(time>999) time=999
var/id = "[TargetMob.key]"
var/ip = "[TargetMob.client.address]"
var/kid = "[TargetMob.client.computer_id]"
KeyBans.Add(id)
IPBans.Add(ip)
IDBans.Add(kid)
world<<"<b><font size=1><font color = red>GM Info: [TargetMob.name] has been banned by [usr] for [time] Days."
del(TargetMob.client) //redundant
if(TargetMob)
del(TargetMob)


Let's clean this guy up:

    Key_Ban()
set category = "Admin"
set name = "Ban"
if(usr.lock||!usr.GM) return //remember, we can't always trust that this verb has been called by someone eligible to have it.
var/list/targets = list()
for(var/client/c in world)
if(c.mob.GM<usr.GM)
targets += c.mob
var/mob/selected = input(usr,"Who would you like to ban?","Ban") as null|anything in targets
if(selected&&selected.client)
if(selected.key in global.owners)
world<<"<b><font size=1><font color = red>Abuse Info: [usr] tried to ban the owner of game!"
return
var/duration = round(input(usr,"How many days? (Note: 0=perm)","Ban",0) as num|null)
if(selected.client&&selected.GM<usr.GM&&duration!=null||duration>=0) //since we had a blocking wait, we need to ensure the client is still valid and the GM still has valid GM privileges.
KeyBans += selected.key
IPBans += selected.client.address
IDBans += selected.client.computer_id
if(duration==0)
world<<"<b><font size=1><font color = red>GM Info: [selected.name] has been permanently banned by [usr]."
else
world<<"<b><font size=1><font color = red>GM Info: [selected.name] has been banned by [usr] for [duration] Days."
del selected
thanks and yeah i figured the logic was bad since what i was trying to do was put the key ip and id all into one list
Also because this drives me nuts, I recommend getting rid of the whitespace around = in your HTML. It's really not good form to put whitespace around the = for an attribute.
Also because this drives me nuts, I recommend getting rid of the whitespace around = in your HTML. It's really not good form to put whitespace around the = for an attribute.

I was gonna mention using CSS and spans, but... You know. Effort.
At the very least, combining the multiple font tags is a good idea.