ID:141341
 
Code:
            Say(msg as text)
if(src.key == "Kongoro"||"Lugia319")
view() << "<font color=purple><b>(Admin)[src.key] says: <font color=silver>[msg]"
else
view() << "<b>[src.key] says:</b>[msg]"
Shout(msg as text)
if(src.key == "Kongoro"||"Lugia319")
world << "<font color=purple><b>(Admin)[src.key] shouts: <font color=silver>[msg]"

else
world << "<b>[src.key] shouts: [msg]"


Problem description:

See, all I'm trying to do is make Admins have purple names, silver text, and an Admin label, for both shouting and saying. But, no matter who logs in, they chat with purple names, silver text, and admin labels. Can anybody please help me make it so anybody without those two keys types with simple black font?

Yurokei wrote:
Code:
>           Say(msg as text)
> if(src.key == "Kongoro"||"Lugia319")
> view() << "<font color=purple><b>(Admin)[src.key] says: <font color=silver>[msg]"
> else
> view() << "<b>[src.key] says:</b>[msg]"
> Shout(msg as text)
> if(src.key == "Kongoro"||"Lugia319")
> world << "<font color=purple><b>(Admin)[src.key] shouts: <font color=silver>[msg]"
>
> else
> world << "<b>[src.key] shouts: [msg]"
>

Problem description:

See, all I'm trying to do is make Admins have purple names, silver text, and an Admin label, for both shouting and saying. But, no matter who logs in, they chat with purple names, silver text, and admin labels. Can anybody please help me make it so anybody without those two keys types with simple black font?


The reason that is happening is because that isn't how || works. It see if src.key == "Kongoro" returns true, then if "Lugia319" returns true. Which "Lugia319" will always return true, it doesn't check both of them to the key. To check both you would to do
src.key == "Kongoro"|| src.key=="Lugia319"

or

src.key in list("Kongoro","Lugia319")


Though that's not very practical. It would probably work better with

if(src.IsGM) 

or

if(src.key in GMList)

or even

if( isGM(src.key) )
In response to T3h P3ngu1n
Thank you VERY much. I knew it'd be something simple along those lines. As far as the things involving lists, both myself and Lugia319 are having difficulties with them, so I'll probably go with the first option. I appreciate you responding. ^^

PS: If you know any good places to learn about lists, let me know (please :D).
In response to Yurokei
I'd recommend the guide and reference, as that's what they have been created for ;)

As a little example of how it could look like in a test environment:

var/list/Administrators = list("Kongoro", "Lugia319")

mob
verb
Say(msg as text)
out(msg, hearers())
Shout(msg as text)
out(msg, world)
proc
out(msg, var/list/lrange)
lrange << "[(src.key in Administrators) ? "<font color=purple><b>(Admin)[src] says: </b></font><font color=silver>[msg]</font>" : "<b>[src] says:</b>[msg]"]"