ID:1825203
 
(See the best response by Mar big.)
Code:
mob/verb/Say(T as text)
set hidden = 1
if(src in DeadChannel)
DeadChannel << "<b><font color=red>(Dead)</b></font color> <b><font color=purple>[usr]: <font color=black><b>[T]"

else
world << "<b><font color=red>(Alive)</b></font color> <b><font color=purple>[usr]: <font color=black><b>[T]"


Problem description:

For some reason this isn't working. I have a code set-up for when the player dies they're added to the DeadChannel list and can only communicate with others from the DeadChannel, but for some reason the chat still shows up with the Alive in brackets and still broadcasts to living players.

I have a feeling it's such an obvious issue, but I've been racking my brain since last night.

mob/proc/DeathCheck(M)
src.Health = 0
src.MaxHealth = 100
src.icon_state="dead"
src.verbs+=(/mob/Death/verb/Spectate)
src.movestop=1
src.Alive = 0
world<<"<font color=red><b><BIG>[src.key] has been killed!"
Alive -= 1
DeadChannel += src


Best response
You need to make sure the list is initialized. Just add a sanity check before trying to add a mob to the list.
if (!DeadChannel) DeadChannel = list()
In response to Mar big
So, like this?

EDIT: I still having a feeling I did something wrong haha. Thanks for the help though!

mob/proc/DeathCheck(M)
src.Health = 0
src.MaxHealth = 100
src.icon_state="dead"
src.verbs+=(/mob/Death/verb/Spectate)
src.movestop=1
src.Alive = 0
world<<"<font color=red><b><BIG>[src.key] has been killed!"
Alive -= 1
if (!DeadChannel) DeadChannel = list()
DeadChannel += src
In response to Manio
Like this.
mob/proc/DeathCheck(M)
src.Health = 0
src.MaxHealth = 100
src.icon_state="dead"
src.verbs+=(/mob/Death/verb/Spectate)
src.movestop=1
src.Alive = 0
world<<"<font color=red><b><BIG>[src.key] has been killed!"
Alive -= 1
if (!DeadChannel) DeadChannel = list()
DeadChannel += src

In response to Mar big
Chat still shows up as (Alive) though. I've got to be missing something simple.

mob/verb/Say(T as text)
set hidden = 1
if(src in DeadChannel)
DeadChannel << "<b><font color=red>(Dead)</b></font color> <b><font color=purple>[usr]: <font color=black><b>[T]"

else
if(src in LiveChannel)
LiveChannel << "<b><font color=red>(Alive)</b></font color> <b><font color=purple>[usr]: <font color=black><b>[T]"


Everything runs fine and looks right to me, so I have no idea. Sorry for being so dense.

EDIT: Sorted everything out. Had some silly usr abuse hidden away in the code. Rookie mistakes.
Just for clarity, and also because src.xxxx will tend to disguise usr abuse making it harder to spot, I recommend ditching src.xxxx in favor of xxxx wherever feasible.

Also, thank you for being one of the few people left who can correctly spell "racking my brain".