ID:171529
 
It only works for the soldier..and when u clcik on the icons i made it so if u click on the soldier soldier=1 and alien=0 and so on..
mob/var/Ctype="soldier"
mob/var/Btype="alien"

mob
verb
Team_Chat(T as text)
for(var/mob/M in world)
if(M.Ctype==src.Ctype)
M<<"<font size=2><font color=green>[src.key] team says:[T]"
else
for(var/mob/N in world)
if(N.Btype==src.Btype)
N<<"<font size=2><font color=purple>[src.key] team says:[T]"
What would "Btype" and "Ctype" hold? You might not be doing the else statement the correct way.
they hold wether the mob is alien or soldier........and what is the correct way then?
A better way to do that would be to hold the players in lists.

var/list/players=list("aliens"=list(),"players"=list())
var/class
mob
Login()
if(TheyChoseToBeAnAlien)//if they're an alien
players["aliens"]+=src
src.class="alien"
else
players["soldiers"]+=src
src.class="soldier"
mob/verb/teamsay(t as text)
var/list/team=players["[usr.class]s"]
team<<"[usr.key]: [t]"



In response to HavenMaster
Yes that could work but it leave me iwth the same colored text.
In response to CodingSkillz2
You could change the text color yourself if you really want to. I didn't give you a solution, I gave you an example.
In response to HavenMaster
well is there a way to change the text like in mine but using your way?or can u just fix mine?
In response to CodingSkillz2
It's fairly simplistic. I think you should look into more tutorials if you don't understand.

If you really want to change their colors, you could do one of two things:

Give them a color variable (purple if alien, green if soldier) then put:

team<<"<font size=2 color=[usr.color]>[usr.key]: [t]"

Or you could use an if statement. Once again, you need some more practice.
In response to HavenMaster
Yup...all nooblers do -_-'
In response to HavenMaster
Your way is more confusing and gives me a few errors.Can any1 else see if they could edit or fix mine?
In response to CodingSkillz2
Learn how to reply to posts correctly.
In response to CodingSkillz2
......reply correctly?What did I do wrong?
In response to CodingSkillz2
It does not give any errors if it's implemented correctly and is far more efficient than your method. Mine sends a message as quickly as sending one to world, yours loops through every mob in the world then runs if statements. You'd be far better off to find out what you're doing wrong with what I gave you than to pursue your idea.
In response to HavenMaster
So it causes lag all because of my crummy coding?!?!
In response to CodingSkillz2
My point exactly.
In response to CodingSkillz2
Yes. Also, when replying to my post, do reply to my post - not one that's totally irrelevant.
In response to HavenMaster
I've already pointed that out to him.
In response to Garthor
I was just clarifying. He didn't seem to understand.
In response to HavenMaster
and still dont i'm jsut going to stop using these forums and only use them as a last resort because some people seem to have anger issues..mabe the being on the comp to much i dunno.and i'm not pointing fingers its alot of ppl....so dont reply cuz i'm not even going to look.
In response to CodingSkillz2
Poor grammar and posting skills enrage us.