//Admin variables.
var/list/admins=list("Howey")
var/list/mutedp=list()
mob/var/muted = 0
//Admin verbs.
client/admin/verb
Mute(mob/M in world)
set category = "Admin"
if(!M.muted)
M.muted = 1
world << "<b>[M] has been muted by [usr]."
mutedp = new
mutedp.Add(M)
sleep(6000)
if(M.muted)
world << "<b>[M] has been auto-unmuted."
M.muted = 0
mutedp.Remove(M)
else
usr << "<b>[M] is already muted."
Unmute()
set category = "Admin"
var/M = input("Who would you like to unmute?")as anything in mutedp
if(M)
world << "<b>[M] has been unmuted by [usr]."
M.muted = 0
mutedp.Remove(M)
Problem description:
Admin.dm:62:error:M.muted:undefined var
This error accurs on the line stated below:
Unmute()
set category = "Admin"
var/M = input("Who would you like to unmute?")as anything in mutedp
if(M)
world << "<b>[M] has been unmuted by [usr]."
M.muted = 0 // <----- This line.
mutedp.Remove(M)
Also, the list doesn't pop up when I click unmute, it just unmutes the person who was last muted.
change it to var/mob/M = input("Who would you like to unmute?")as anything in mutedp
your problem is that it wasnt defined to be a mob, so it didnt have the mob variable.
Also, not sure if this is the answer to your last problem, but when theres only one item in a list, it automatically picks that item. So if theres only one muted person in the list, it'd pick it without prompting you, so you're better off adding a "Cancel" text too it, and before it mutes the person it would check if you selected cancel, if not then go ahead and mute/unmute