Dont copy/paste this cause its not from DM I typed it in the reply so its no tabbed or anything. Also it might need a lil work cause like I said I didnt actually make it in DM and compile it so I dunno if it'll work 100% like in my mind it does.
Fairly close.
Aridale wrote: mob/var/MyListShower = new(obj/ListShower) Firstly, that's not a correct use of new(). Secondly, you'll get an "expected a constant expression" error on this line. Instead, do this: <code>mob/var/obj/ListShower/MyListShower mob/New() .=..() MyListShower = new()</code> mob/Stat() This is nearly right, except you'll probably want to display the mob rather than the client. And "var/client/C in world" won't work, because the clients are not in the world; it's just "var/client/C". EDIT: Whoops, forgot to remove "in world" from the client loop. Thanks Loduwijk! |
for(var/client/C in world) shouldn't work at all. client's are not in the world, just their mobs are. The only thing that is actually in world are things that are subclasses of /atom. The world has various areas, and the areas have 1 or more turfs in them which are arranged in a cube pattern. /atom/movable then go on the turfs, this includes both mobs and objs. (mob and obj can also be in other mob or obj)
That is how the byond world goes 'round. Types /client and /list are not even derived from /datum yet, it would be difficult to put them on the world if you wanted to. |
Click()
if(usr.bShowOnline)
usr.bShowOnline = FALSE //or 0
return
else
usr.bShowOnline = TRUE //or 1
New()
src.loc = null //moves it to the void on creation
mob/var/MyListShower = new(obj/ListShower)
mob/Stat()
statpanel("Online")
stat(MyListShower)
if(bShowOnline)
for(var/client/C in world)
stat(C)