Ban_Player(mob/PC/M in world)
set category = "GM"
var/savefile/H = new("H_Admin.ban")
var/Reason
switch(alert("Include a Reason for Banning [M]?","Mute","Yes","No"))
if("Yes")
var/Reason2 = input("What is the reason for Muting [M]")as text
Reason = Reason2
switch(alert("Ban [M]'s Key, IP or Both?","Ban [M]","Key","IP","Both"))
if("Key")
Banned_Key += M.ckey
H["Banned_Key"] << Banned_Key
if("IP")
Banned_IP += M.client.address
H["Banned_IP"] << Banned_IP
if("Both")
Banned_Key += M.ckey
Banned_IP += M.client.address
H["Banned_Key"] << Banned_Key
H["Banned_IP"] << Banned_IP
if(!Reason)
world << "\red [M] has been Banned"
else
world << "\red [M] has been Banned «Reason: [Reason]»"
del(M)
Unban_Player()
set category = "GM"
var/savefile/H = new("H_Admin.ban")
switch(alert("Unban a Key or IP?","Unban","Key","IP"))
if("Key")
var/M = input("What Key do you want to Unban?","Unban Key")as null | anything in Banned_Key
if(!M)src << "No Keys to Unban!";return
Banned_Key -= M
H["Banned_Key"] << Banned_Key
src << "\red [M] has been Unbanned"
GMMessage("[src] Unbanned Key: [M]")
if("IP")
var/M = input("What IP do you want to Unban?","Unban IP")as null | anything in Banned_IP
if(!M)src << "No IPs to Unban!";return
Banned_IP -= M
H["Banned_IP"] << Banned_IP
src << "\red [M] has been Unbanned"
GMMessage("[src] Unbanned IP: [M]")
Unban not working