ID:147003
 
mob
verb
Say(msg as text)
set category = "Social Commands"
view() << "\icon[usr]<font color=blue>[usr] says: [msg]"
for(var/mob/M in world)
if(M.GMCheck() || M.AdminGMCheck() || M.key == MASTER_KEY || M.key == MASTER_KEY_TWO || M.key == MASTER_KEY_THREE)
var/list/X = list()
for(var/mob/M2 in view())
if(M != M2)
X+=M2
if(X.Find(M))
M << "\icon[usr]<font color = purple>[usr.name] says: [msg]"


Tell(M as mob in world, msg as text)
set category = "Social Commands"
M << "\icon[usr]<font color=black>[usr] tells you: [msg]"
usr << "<font color=black>You tell [M]: [msg]"
for(var/mob/M2 in world)
if(M2.GMCheck() || M2.AdminGMCheck() || M2.MasterGMCheck())
if(M != M2)
M2 << "[usr] tells [M]: [msg]"


I need the Say and Tell verbs to reflect in GM's text boxes (who are not already in the player's view). I swear I had it once but I dunno what I did >_<
From what I'm reading, you want GMs to be able to read ALL "say" calls, and be able to read a "tell" sent to anyone (I'll not go into the moral issues of this right now). For the say, you were sort of on the right track, but went a little wrong. You're checking first to see if a mob is a GM... good. But after that, things go a little awry. First, you'll need a list defined in the scope of the whole verb (not within any of the loops), and then, when you run through all the mobs in the world, and check them for "GM" status, you'll add them to this list. After that loop gets done, you'll have a list of GMs. Now, you probably don't want the GMs in view of the original say to get a double-post, so you'd run through the list, and check if the GM was in view of the person using "say". It'd go something like this:

mob
verb
Say(msg as text)
set category = "Social Commands"
var/list/gms = new()
view() << "\icon[usr]<font color=blue>[usr] says: [msg]"
for(var/mob/M in world)
if(M.GMCheck() || M.AdminGMCheck() || M.key == MASTER_KEY || M.key == MASTER_KEY_TWO || M.key == MASTER_KEY_THREE)
gms += M
for(var/mob/double in gms)
if(!(double in view()))
double << "\icon[usr]<font color = purple>[usr.name] says: [msg]"


As for the tell command, it looks pretty kosher, so you may want to check and make sure the GM checking functions are doing what they're supposed to do.
In response to Igmolicious
The above works aswell, but rather than looping through all the mobs in the world you can get rid of all of the for() loops.

var/list/ADMINS=list()

mob
Login()
if(M.GMCheck() || M.AdminGMCheck() || M.key == MASTER_KEY || M.key == MASTER_KEY_TWO || M.key == MASTER_KEY_THREE)
ADMINS+=src
..()
Logout()
ADMINS-=src
..()

verb
Say(msg as text)
set category="Social Commands"
view() << "\icon[usr]<font color=blue>[usr] says: [msg]"
ADMINS << "\icon[usr]<font color=blue>[usr] says: [msg]"
In response to Nick231
Cowdude: "I need the Say and Tell verbs to reflect in GM's text boxes (who are not already in the player's view)."

Nick231:
...
verb
Say(msg as text)
set category="Social Commands"
view() << "\icon[usr]<font color=blue>[usr] says: [msg]"
ADMINS << "\icon[usr]<font color=blue>[usr] says: [msg]"

That would double message any 'ADMIN' that is near the person saying the message. Which is what Cowdude didn't want. But that would work.

Here is my little change. Igmolicious's code works also.
mob
verb
Say(msg as text)
set category = "Social Commands"
view() << "\icon[usr]<font color=blue>[usr] says: [msg]"
for(var/mob/M in world)
if(M in view()){continue}
if(M.GMCheck() || M.AdminGMCheck() || M.key == MASTER_KEY || M.key == MASTER_KEY_TWO || M.key == MASTER_KEY_THREE)
M << "\icon[usr]<font color = purple>[usr.name] says: [msg]"

EDIT: Spacing was messed up.
I basically removed the Admins/GMs list, and shortened the code a little.
In response to JackGuy
That has the same effect I gave except it changed the color of the text admins always see (which is a good idea otherwise they won't be able to have a conversation on their own without seeing it twice).

var/list/ADMINS=list()

mob
Login()
if(M.GMCheck() || M.AdminGMCheck() || M.key == MASTER_KEY || M.key == MASTER_KEY_TWO || M.key == MASTER_KEY_THREE)
ADMINS+=src
..()
Logout()
ADMINS-=src
..()
verb
Say(msg as text)
set category="Social Commands"
view() << "\icon[usr]<font color=blue>[usr] says: [msg]"
ADMINS << "\icon[usr]<font color=purple>[usr] says: [msg]"


Same thing, no loop.