ID:155697
 
mob/var
dontknow
mob/verb/Say(msg as text)
var/t1=copytext(msg,1,12)
var/t2=copytext(msg,12)
var/list/N
N=list("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z")
if(findtextEx(t1,"[src]"))
for(var/mob/O in view(13))
if(O.dontknow==src.name)
O.dontknow += src.name
view(12)<<output("<font size=1 color=red><b>[src]:</b></font> [msg]","say")
else
for(var/mob/O in view(13))
if(O.dontknow==src.name)
view(12)<<output("<font size=1 color=red><b>[src]:</b></font> [msg]","say")
break
else
view(7)<<output("Unknown : [msg].","say")




I'm trying to do with who does not know the name of the person and the person speaking the name who in view know the name.More appear if a person does not speak her name then appears "unknown ". Most have no idea what to do.
Help please.

Example
Soul(My) : Hey
Unknown(Any guy) : Hello
Soul(My) : What you name?.
Unknown(Any guy) : My name is Zaza
Soul(My) : nice meet you zaza.
Zaza(Any guy) : nice meet you too
I hope this is what you are looking for. I haven't tested it so let me know how it goes.

client/New()
..()
mob.known_persons += mob//We know ourself so we should add ourself to our known_persons list.

mob/var
list/known_persons = list()

mob/verb/Say(msg as text)
if(findtextEx(msg, name))//If you say your name everyone in view will will know it.
for(var/mob/m in view(13))
if(!m.known_persons.Find(src) && m != src)//Make sure that if they know the person we don't add them to their known_persons list again.
m.known_persons += src
for(var/mob/m in view(13))
if(findtextEx(msg, m.name))//If the person talking says the name of someone in view he will know their name when they talk next.
if(!known_persons.Find(m))known_persons += m//If the speaker doesn't know the person add them to the speaker's known_persons list
for(var/mob/p in view(13))//Anyone in view when a person's name was said will also know the person's name which was said.
if(!p.known_persons.Find(m) && p != src)//Make sure that if they know the person we don't add them to their known_persons list again.
p.known_persons += m
if(m.known_persons.Find(src))m<<output("<font size=1 color=red><b>[src]:</b></font> [msg]","say")//If the person hearing the speaker knows their name it will show the speaker's name.
else m<<output("Unknown : [msg].","say")//If they don't know the speakers name the speaker will be shown as unknown.
I think you'd be better of making something like a list of names.

When you create your character your name is added to the list and when you speak it will loop through the mobs in the area. If your name is in their namelist then it will appear to them, if your name is not in their namelist it will appear as "unknown".

Then, when you actually do speak, it will look through the message for the names of everyone in the immediate area, if their name is in the message then everyone who hears that message will have that name added to their namelist, unless it already exists.

Basically, when you speak it checks the other players to see if they know your name, and while it does that it checks your message to see if anyone elses name is spoken.
In response to Zaltron
Zaltron wrote:
I hope this is what you are looking for. I haven't tested it so let me know how it goes.

client/New()
> ..()
> mob.known_persons += mob//We know ourself so we should add ourself to our known_persons list.
>
> mob/var
> list/known_persons = list()
>
> mob/verb/Say(msg as text)
> if(findtextEx(msg, name))//If you say your name everyone in view will will know it.
> for(var/mob/m in view(13))
> if(!m.known_persons.Find(src) && m != src)//Make sure that if they know the person we don't add them to their known_persons list again.
> m.known_persons += src
> for(var/mob/m in view(13))
> if(findtextEx(msg, m.name))//If the person talking says the name of someone in view he will know their name when they talk next.
> if(!known_persons.Find(m))known_persons += m//If the speaker doesn't know the person add them to the speaker's known_persons list
> for(var/mob/p in view(13))//Anyone in view when a person's name was said will also know the person's name which was said.
> if(!p.known_persons.Find(m) && p != src)//Make sure that if they know the person we don't add them to their known_persons list again.
> p.known_persons += m
> if(m.known_persons.Find(src))m<<output("<font size=1 color=red><b>[src]:</b></font> [msg]","say")//If the person hearing the speaker knows their name it will show the speaker's name.
> else m<<output("Unknown : [msg].","say")//If they don't know the speakers name the speaker will be shown as unknown.




Thx all ok