ID:139800
 
Code:
        Say(msg as text)
set category = "Communication"
set name = "Say"
if(!usr.OOC)
return
if(usr.testing)
usr<<"Not right now!"
return
if(filter(msg,tags) == TRUE)
usr.html()
return
else
if(spamcheck == TRUE)
usr << "Spam rate exceeded please wait a moment and try again!"
return
else
usr.spamcheck()
msg=cuttext(msg)
world.log << "Say [usr]: [msg]"
view(usr) << "<font size=1><font face=verdana><b><font color=white><IMG CLASS=icon SRC=\ref[usr.faceicon]><font size = 1>[usr]<font color= red> Says: [msg]"
for(var/mob/M in world)
if(M.viewtext)
M << "<font size=1><font face=verdana><b><font color=white><IMG CLASS=icon SRC=\ref[usr.faceicon]><font size = 1>[usr]<font color= red> Says: [msg]"
text2file("[time2text(world.realtime)]:<IMG CLASS=icon SRC=\ref[usr.faceicon]><font size = 1>[usr] says, [msg]","Saylog.txt")


Problem description:
Okay.. so here is the code for the Say verb... I have a listen verb that can make it hear everything else one says, OOC, Emote, Village Say, Say, Guild Say, Squad Say, Whisper, w/e it is.. but for this verb, Say, and Emote... I seem to be seeing the text twice if I'm talking.. I know the problem that it tells the mob that has "viewtext" on and to the view of usr. so is there a way to make it only say it once, and not twice when I talk or when I'm in view of someone else talking? Help please, I appreciate your time.
Instead of looping through every mob in the world, loop for(var/client/C), then check C.mob.viewtext. Also, check if C.mob is in view(), and don't display the message if they are.
In response to Garthor
Thanks a lot.. that helped. :)