ID:158870
 
Pretty much what i am wondering is how to do a scoreboard, so that i can like sya for instance put in the browser place, the top 10 players? i have been working and trying alot of things but i cannot figure out how to make it overall players not just online players. Any help?
Did you bother to check out the resource section http://www.byond.com/members/?command=search&type=resources ?
You'll need to use a savefile for that. Simplest thing is just to keep a list and save it when it changes, and load it when you start up the world.

var/const/MAXSCORES = 10
var/list/scores[MAXSCORES]
var/list/scorenames[MAXSCORES]

world/New()
var/savefile/F = new("scores.blag")
if(F)
F >> scores
F >> scorenames

proc/addscore(var/score, var/name)
//find where score would place
var/v = 1
for(, v <= MAXSCORES, v++)
//break the loop on the first score we find that we beat
//(ties will go to seniority)
if(score > scores[v])
break

//if we found we beat a score (will be MAXSCORES+1 if we don't)
if(v <= MAXSCORES)
scores.Insert(score)
scores.Cut(MAXSCORES+1)
scorenames.Insert(name)
scorenames.Cut(MAXSCORES+1)
//we now save the lists
var/savefile/F = new("scores.blag")
if(F)
F << scores
F << scorenames
//we might as well return where we are on the high scores list
return v
else
return 0