ID:150207
 
mob/var/color
mob/var/blue
mob/var/red

if("Blue")
src.arena = 2
src.team = 1
icon = 'ctfblue.dmi'
src.loc = locate(/area/blue)
<B>src.color = blue</B>


Above is one of the teams when a player logs on.

    who()
set desc="Current players on Paintball Outpost"
set category = "Communication"
for(var/mob/M in world)
if(M.client)
usr << "<B>Current players online:</B>"
usr << "Player - Team"
usr << "------------------------------"
usr <<"<font color=[M.color]>[M]</FONT>"


And here is the who command, I am having problems getting the color to show up. The name shows up, but not their team color. Sorry about this but I have spent about an hour and cannot figure it out.
Looks like a typo here:

<B>src.color = blue</B>


Take out the bold tags. They don't belong in this assignment.
Instead of src.color=blue, try it with text: src.color="blue".

Lummox JR
In response to Skysaw
Skysaw wrote:
Looks like a typo here:

<B>src.color = blue</B>

Take out the bold tags. They don't belong in this assignment.

I was trying to bold that for you to see the problems.

Thanx, got it working finally. But how do you delete the spaces between? Ex..

Someone makes a name AbeLincoln, then someone else makes a long name like magicfranklinguy. How do I get the who() to delete the spaces between there names and the arena(this probably makes no sense yet).

Current Players online:
Players - Arena
------------------------------
AbeLincoln CTF
magicfranklinguy CTF

That is how it shows up right now, but I want it to show like this:

Current Player online:
Players - Arena
------------------------------
AbeLincoln CTF
magicfranklinguy CTF


So that it shows CTF in a row no matter how long their name is.

usr <<"<font color=[M.color]>[M]</font>             <B>[M.arena]</B> "


I think I need to put something in between </font> and [M.arena]"
In response to Oblivian
If you set it up right you could do it it HTML <TABLE>
format.

LJR
In response to LordJR
LordJR wrote:
If you set it up right you could do it it HTML <TABLE>
format.

Actually that won't work, because the text output doesn't support the <TABLE> tag. The only real way to do it with a table would be to use browse() to do it.

However, one way of lining up text in the output would be to format it with <TT>, which should make all characters appear in the Courier font (or one like it) where they all line up like typewriter output or code.

Lummox JR
In response to Lummox JR
Though using the browser for "who verbs" can lead to some really fun experimenting.
In response to Oblivian
Oblivian wrote:
Thanx, got it working finally. But how do you delete the spaces between? Ex..

Someone makes a name AbeLincoln, then someone else makes a long name like magicfranklinguy. How do I get the who() to delete the spaces between there names and the arena(this probably makes no sense yet).

Current Players online:
> Players - Arena
> ------------------------------
> AbeLincoln CTF
> magicfranklinguy CTF
>
> That is how it shows up right now, but I want it to show like this:
>
> Current Player online:
> Players - Arena
> ------------------------------
> AbeLincoln CTF
> magicfranklinguy CTF

So that it shows CTF in a row no matter how long their name is.

I have a routine that does exactly this in My Life as a Spy. What you need to do is make sure you are in a mono-spaced font, so use courier. Then you need to pad all the names with spaces so that they are all the same length on display. Here's the steps for that:

1. Truncate all the names to a maximum of about 16 chars (or however long you wish)
2. Add about 20 spaces to the ends of each name.
3. Truncate again to the width you want (name + margin).

They will all be the same size in mono-spaced fonts now.

I have code somewhere I might be able to dig up if you have trouble.
In response to Skysaw
Ah, thanks Skysaw! I had just posted, asking if anyone knew about a mono-spaced font when I read this =)

Yay!
Alathon
In response to Skysaw
Thanx for the info :)
In response to Skysaw
Thanx for the info :)