ID:142853
 
Code:
var/
mutecheck = 0
subspaceblock = 0
channel = "default"

mob
verb
say(msg as text)
for(mob/M in "world")
if(M.channel==channel)
M << output({"\icon[usr.icon]<font color="#[usr.textcolor]"><b>[usr.name]:</b></font> [html_encode(msg)]"})


Problem description: its basically saying wth is "M"? I am sure its a simple character error but I can't find it! either that or I am trying to apply code to something and it just doesn't work that way. I am trying to make it check for every mob/M in the world that has the same [channel] as me and output [msg] to each of them.

for(var/mob/M in world)
Problem: last question fixed, this one is new and I have had this problem before. it has to do with list.Add()
Code
    Create_New_Channel()
set category = "Staff"
var/newchannel = input("Insert the name of the new channel", "Channel", "")
world << "The channel <b>[newchannel]</b> has been created by [src]"
channel.Add()

I have tryed the following things for adding the variable to the channel list.
        channel.Add(newchannel)
channel.Add("newchannel")
channel.Add([newchannel])
channel.Add("[newchannel]")

Everytime it says
"chat_uc.dm:57:error:channel.Add:undefined proc"
I have one more question if you can help me with that. I want the default input for new/var/channel to be channel.len +1 how do I put that in there?
In response to Arcangelbjr (#2)
channel += newchannel


Assuming you have the varible set up as a list?

var/channel = list()


As for the second question, I don't understand what you want?
In response to Arcangelbjr (#2)
channel is not a list and therefore treating it like one does not make any sense. Hence, the error.