ID:145296
 
Code:
client/verb/Who()
var/mob/M
usr << "<center><font color=red size=0 style=verdana>-=Online Players=-</font></center>"
for(M in world)
if(M == usr) continue
if(M.key) usr << M.key


Problem description:
when i started the game, and click the Who button the only thing that shows up is the -=Online Players=- .... and the users online wont show up.. please help me thanks....
        Who()
usr << "----------"
usr << "<small>Online: </small>"
for(var/mob/M)
if(M.client)
usr << "<font color = green><font size = 1>[M.name]</font></b></i></font></b></i><font size = 1><font color = blue> (Key:[M.key])</font>"
In response to XzDoG
What's the counter var for?
Plus, that HTML could do with a bit of clearing up...

*edit*

You fixed it, so my criticism doesn't still stand. =p
In response to Elation
Whoops, I had planned to make it count people but never did that. *Edits*
In response to XzDoG
Why do you do a for() loop for ALL mobs? Why not just clients?
VirusE2006 wrote:
Code:
> client/verb/Who()
> var/mob/M
> usr << "<center><font color=red size=0 style=verdana>-=Online Players=-</font></center>"
> for(M in world)
> if(M == usr) continue
> if(M.key) usr << M.key
>

Problem description:
when i started the game, and click the Who button the only thing that shows up is the -=Online Players=- .... and the users online wont show up.. please help me thanks....

this may be stupid but..
mob/verb/Who()
for(var/mob/m)
if(m.client)
src <<"[src.key]"


Will work perfectly fine.

OR you could use my who verb
            who()
src << "Online Players:[ppl]"
for(var/mob/m)
if(m.client)
src <<"[m.key]"


Note it's tabbed
In response to Fusioneko
mob/verb/Who()
usr<<"<center>---------------<br>Players Online</center>"
for(var/client/C) usr<<"[C.mob] - [C]"
usr<<"center>---------------</center>"
In response to Mysame
Mysame wrote:
> mob/verb/Who()
> usr<<"<center>---------------<br>Players Online</center>"
> for(var/client/C) usr<<"[C.mob] - [C]"
> usr<<"center>---------------</center>"


Thats if you wanna do it fancy :o lol and thats sophisticated.
In response to Fusioneko
And much more efficient if you have a game full of monsters/npcs.
I normally keep a list of players logged in for various reasons e.g login times/z level of player swapmap (both from Legacy).
In response to Mysame
Mysame wrote:
> mob/verb/Who()
> usr<<"<center>---------------<br>Players Online</center>"
> for(var/client/C) usr<<"[C.mob] - [C]"
> usr<<"center>---------------</center>"


use [C.mob.name] and [C.key] to avoid having "the splattergnome" effect.
In response to Airjoe
Airjoe wrote:
Mysame wrote:
> > mob/verb/Who()
> > usr<<"<center>---------------<br>Players Online</center>"
> > for(var/client/C) usr<<"[C.mob] - [C]"
> > usr<<"center>---------------</center>"

use [C.mob.name] and [C.key] to avoid having "the splattergnome" effect.

"Splattergnome" Effect' What is THAT ??
In response to Mysame
Mysame wrote:
Why do you do a for() loop for ALL mobs? Why not just clients?

for(var/client/c in world)

That avoids some lines, like:
for(var/mob/m in world)
if(m.client)

or maybe osme nerds can try this: NOTE. this is an obssessive nerd code.
for(var/mob/m in world)
if(m.client && m.key && m.client.screen && m.client.eye && m.client.mob)
world << "Wow. It's a real person."
In response to Gooseheaded
I know i saw a demo game with something like this in it.. im not sure which one tho.. i think it might be the statclass one
In response to Gooseheaded
Well, I don't know, but I'm guesisng it has something to do with the text box just automatically spitting out blank lines constantly. That was a problem I used to have and no one seemed to know what was going on.
In response to Gooseheaded
Or, y'know, you can check for a client. A client is a real person, always. All those checks are useless.
In response to Gooseheaded
It's when someone whose key starts with a lowercase letter gets "the" placed in front of their name whenever they say something.
In response to Airjoe
Not just when they saying something, but any message that has the player's name in it will have "The" in front of it, such as when a player logs in/out.