ID:145760
 
Code:
world
New()
..()
if(fexists("Data.sav"))
var/savefile/F=new("Data.sav")
F["muted"]>>muted
F["banned"]>>banned
F["ipbanned"]>>ipbanned
Time_Proc()
sleep(rand(400,640))
breeze=1
Breeze()
Del()
var/savefile/K=new("Data.sav")
K["muted"]<<muted
K["banned"]<<banned
K["ipbanned"]<<ipbanned
..()

And the mute/unmute verbs-
 mute(t as text)
set category="Admin"
if(!(ckey(t) in muted))
if(ckey(t)!=ckey)
if(ckey(t))
if(alert("Are you sure you want to mute [ckey(t)]?",,"Yes","No")=="Yes")
muted.Add(ckey(t))
world<<"[Edward][ckey(t)] was muted by [src].</b></font>"
else src<<"<b>You can't mute yourself!</b>"
else src<<"<b>[ckey(t)] is already muted.</b>"
unmute()
set category="Admin"
if(muted.len)
var/a=input("Who do you want to unmute?")as null|anything in muted
if(a)
if(alert("Are you sure you want to unmute [a]?",,"Yes","No")=="Yes")
if(a in muted)
muted.Remove(a)
world<<"[Edward][a] was unmuted by [src].</b></font>"
else src<<"<b>[a] is not muted.</b>"
else src<<"<b>There are currently no muted keys.</b>"


Problem description: For some reason whenever I unmute a key and reboot the world, the ckey is still in the muted list.

try using muted-=a

I was told by a pretty respecable source that -= and += is better than remove and add in most cases.
In response to Evi of au
Wouldn't make a difference considering I use Remove() for the banned list, too, and everything works fine.
try not adding there name to a mute list but adding a variable to them for example:
for the mute use-
usr.mute=1

then for the unmute use-
usr.mute=0

then for your say verb use-
if(usr.mute==1)
alert("You are muted")
..()
else
-your say code here-


if you use that system you should have no problem with the saving uf who is or isn't muted.
In response to Dark Krow
Please use <dm>code</dm> tags, and that "system" is wrong;

if(usr.mute==1) should be if(usr.mute), it's more robust although that isn't a major thing.

alert("You are muted") Alerts are very annoying. If anything, it should be text.

..() This calls the parent proc/verb, in this case it's absolutely useless.

I figured out the bug, however, the first thing saved and loaded doesn't save right so I suspect a BYOND bug, so I'll just use an empty list to hold that first spot.