ID:147046
 
I want to know how to tell if a user is in a certain channel that is being removed, so the removal gets cancelled until nobody is in that channel. Here is a snippet that I need to have changed:
var/rnc = pick("red", "orange", "yellow", "green", "teal", "cyan", "blue", "indigo", "violet")
var/global/list/stations = list(" Main Lobby","Newbie Central","Recruitment Center","Designing Philosophy","Advertising","Ub3r Land")
var/sound
mob/var/sta = "Main Lobby"
var/susrs

mob/verb
delete_channel()
set hidden = 1
set name = "delchann"
src.sta = input("What room do you wish to remove?","Delete Room") in stations
if(sta == " Main Lobby" || sta == "Newbie Central" || sta == "Recruitment Center" || sta == "Design Philosophy" || sta == "Advertising" || sta == "Ub3r Land")
if(src.sta && stations)
usr << "You cannot delete this channel because you or someone is in it."
usr << "You cannot delete this channel."
else
stations -= sta
world << "Channel [sta] has been removed."


join()
set hidden = 1
set name = "join"
set category = null
src.sta = input("What room do you wish to join?","Join Room") in stations
src << "<font color=[rnc]>You connect to <b>[src.sta]</b></font>"
Make associative multi-dimensional lists. Like so:
var/list/Channels=list("Main Lobby"=list(),"Newbie Central"=list())


Then, to add to those lists, just do this:

Channels["Main Lobby"]+=new/mob


And, to see all who's in those channels, do this:

for(var/X in Channels)
src<<"[X]:"
for(var/People in Channels[X])
src<<"[People]"


And, to "delete" channels, do this:

var/list/Temporary=list()
Temporary.Add(Channels["Main Lobby"])
Channels.Remove("Main Lobby",null)
Channels[1]+=Temporary
del(Temporary)