ID:145128
 
Code:
//Part of my who code.

for(var/mob/M in world)
if(M.Ghost == 1 || M.name == "") //<-- Bad assignment line :(
count --
return
if(M.client)
count ++
dok += "<tr><td width=50%><center>[M.name]</font></center></td><td width=50%><center><a href=?src=\ref[src];action=keyc;Title=[M.ckey]>[M.key]</a></center></td></tr>"
dok += "<tr><td width=100% colspan=2><p align=center><b>Total: [count]</b></td></tr>"
usr << browse(dok,"window=playersonline;size=650x350")


Problem description:
Well, i am getting a bad assignment error, and i don't know why.
I don't know what the problem is, but here are a few other problems I noticed.

//Part of my who code.

for(var/mob/M in world) //your searching for mobs in the world, when you should only search for clients
if(M.Ghost == 1 || M.name == "") //search for "boolean vars"
count --
return //return would return the whole process, remove it.
if(M.client)
count ++
dok += "<tr><td width=50%><center>[M.name]</font></center></td><td width=50%><center><a href=?src=\ref[src];action=keyc;Title=[M.ckey]>[M.key]</a></center></td></tr>"
dok += "<tr><td width=100% colspan=2><p align=center><b>Total: [count]</b></td></tr>"
usr << browse(dok,"window=playersonline;size=650x350")
I'm not sure why you'd have a bad assignment error there either, but I can tell you one thing needs fixing. That should just be M.Ghost, not M.Ghost==1. For true/false values, never ever use ==1 or ==0 to test them. Use if(var) or if(!var) instead, respectively.

Lummox JR
In response to Lummox JR
Oh well, i will just take that part out for now. Thanx for the help.