ID:142521
 
Code:
//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.
Howey wrote:
Code:
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
In response to Chibi-Gohan0
I tested it by muting me and a friend, but it still only unmuted the one person without giving me a choice of who to unmute.
In response to Howey
also, you'd probably want just
var/mob/M = input("Who would you like to unmute?") in mutedp

you dont really need the anything in this case.
In response to Chibi-Gohan0
Well, you do, because you want to give the input a cancel button:

var/mob/M = input("ASDFS") as null|anything in mutedp