ID:177722
 
Could anyone give me a code for showing how many plater are onling. Like in Stats It Says Players Online: 1 or however many online.

And is it possible to make a GM verb thats shows you your game statistics. Like How many Different people have came on and how long they were on.
Codesterz wrote:
Could anyone give me a code for showing how many plater are onling. Like in Stats It Says Players Online: 1 or however many online.

This is basically a matter of keeping a global player list:
var/list/players=list()

mob
Stat()
statpanel("Players")
stat("[players.len] player\s online:")
for(var/mob/M in players)
if(!M) players-=null;continue
stat("[M.name]","$[cash] - Level [level]")

Login()
..()
players+=src

Logout()
players-=src

And is it possible to make a GM verb thats shows you your game statistics. Like How many Different people have came on and how long they were on.

Yes, it is.
Basically you'd want to keep another list:
var/list/playertime=list()  // the amount of time each player has been on

mob
var/logintime
var/loginkey

Login()
..()
loginkey=client.ckey
logintime=world.time
if(loginkey in playertime)
logintime-=playertime[loginkey]
players+=src

Logout()
players-=src
playertime[loginkey] // can't use client.ckey here

TimeLoggedIn()
return world.time-logintime

Each item in playertime will be a player's ckey, with the time they've been logged in (in ticks) stored in an associated value.
If you want a more thorough log of players coming and going, you'll need something quite a bit more complex.

Lummox JR