ID:150242
 
I am having problems with my who command, heres the code..

who()
set desc="Current players on Paintball Outpost"
set category = "Communication"
var/mob/M
usr << "Current players online:"
usr << "Player"
usr << "---------------------------"
for(M) // PCs and NPCs
if(M.client) // filter out PCs
if(src.arena==1)
if(src.team==1)
usr << "\blue[M.key](Elimination)"
else if(src.team==2)
usr << "\red[M.key](Elimination)"

else if(src.arena==2)
if(src.team==1)
usr << "\blue[M.key](CTF)"
else if(src.team==2)
usr << "\red[M.key](CTF)"

It only shows if ur playing ctf, the other ctf players(on your team) vise-versa. Thanx for any help : )
anyone?
In response to Oblivian
Oblivian wrote:
anyone?

Here:

mob/verb/who()
set category = ("Communications")
var/mob/M
usr << "Players:"
for(M)
if(M.client)
usr << M.key


Lee
In response to Mellifluous
I know that much, look at my code in the first post.
for(M) // PCs and NPCs
if(M.client) // filter out PCs
if(src.arena==1)
if(src.team==1)


The problem you're having is that you're checking values against src, not M.
You may find the code easier if you cut out a lot of the if statements:
for(M)
if(M.client)
usr << "[(M.team==1)?"\red[M.key]":"\blue[M.key]"] ([(M.arena==1)?"Elimination":"CTF"])"

Just a reminder for the future: Please don't bump your posts.

Lummox JR