ID:146374
 
Ive code this up myself and i get this error for some reason

#define DEBUG
/var/const/
scoreboard={""}
scoreboardtitle={"<STYLE>BODY {background: black; color: white}</STYLE><head><title>Scoreboard</title></head></body>"}
/Rank_Entry/
var{Name;Key;maxpowerlevel;Date}
New(mob/person)
if(!person)return
Name=(person.name)
Key=(person.key)
maxpowerlevel=(person.maxpowerlevel)
Date=(time2text(world.realtime))
/proc/
RankingDisplay(var/mob/person)
var/list/maxpowerlevel=new()
var/savefile/F=new("levels.sav")
F[("stuff")]>>(maxpowerlevel)
var/html="<center><TABLE BORDER=1><TR><TH><html><BODY><center><h1>Scoreboard</h1><TABLE CELLSPACING=10>"
if(!maxpowerlevel)html+="<TR><TD>No high rankings to display.</TD></TR>\n"
else
html+="<tr><th>#</th><th>Name (key)</th><th>Level</th><th>Date</th></tr>\n
"
for(var/number in 1 to maxpowerlevel.len)
var{character=(maxpowerlevel[(number)]);Rank_Entry/player=(maxpowerlevel[(character)])}
html+="<tr><td>[(number)]\th</td><td>[(player.Name)] ([(player.Key)])</td><td>[num2text(round(player.maxpowerlevel),100)]</td><td>[(player.Date)]</td></tr>\n"
person<<browse("[scoreboardtitle][html]","window=scoreboard;size=524x344")
Ranking(var/mob/player)
if(!player||!player.client)return
var/savefile/F=new("levels.sav")
var/list/maxpowerlevel=new()
F[("stuff")]>>(maxpowerlevel)
if(!maxpowerlevel)maxpowerlevel=new()
var{character="[(player.client.ckey)]/[(player.name)]"
score=maxpowerlevel.Find(character)
Rank_Entry/newest=new(player)
Rank_Entry/last}
if(score)
var/Rank_Entry/old=(maxpowerlevel[(character)])
if(old.maxpowerlevel>=player.maxpowerlevel)return score
while(score>1)
last=maxpowerlevel[(maxpowerlevel[(score-1)])]
if(last.maxpowerlevel>=player.maxpowerlevel)break
maxpowerlevel[(score)]=(maxpowerlevel[(score-1)])
maxpowerlevel[(--score)]=(character)
maxpowerlevel[(maxpowerlevel[(score+1)])]=(last)
maxpowerlevel[(character)]=(newest)
F[("stuff")]<<(maxpowerlevel)
return score
score=(maxpowerlevel.len)
if(score>=100)
last=(maxpowerlevel[(maxpowerlevel[(score)])])
if(last.maxpowerlevel>=player.maxpowerlevel)return 11
maxpowerlevel[(score)]=(character)
else score=(maxpowerlevel.len+1),maxpowerlevel+=(character)
while(score>1)
last=(maxpowerlevel[(maxpowerlevel[(score-1)])])
if(last.maxpowerlevel>=player.maxpowerlevel)break
maxpowerlevel[(score)]=(maxpowerlevel[(score-1)])
maxpowerlevel[(--score)]=(character)
maxpowerlevel[(maxpowerlevel[(score+1)])]=(last)
maxpowerlevel[(character)]=(newest)
F[("stuff")]<<(maxpowerlevel)
return score


scoreboard.dm:21: unterminated text (expecting ")
scoreboard.dm:22: unterminated text (expecting ")
scoreboard.dm:23:error: expected expression


Got any reasons why its doing this?
   html+="<tr><th>#</th><th>Name (key)</th><th>Level</th><th>Date</th></tr>\n
"

It's this line, put { } brackets around the ""'s

Note: Since you didn't tell us which line it was, I think you could figure out where this goes. =P
In response to Flame Sage
Fix it but now when i click on scoreboard my name doesnt come up with a level or powerlevel for some reason all i see is Scoreboard
No high rankings to display
In response to Govegtos
Govegtos wrote:
Fix it but now when i click on scoreboard my name doesnt come up with a level or powerlevel for some reason all i see is Scoreboard
No high rankings to display


It SEEMS like you didn't make this yourself, seeing as how you do not know how to use it.

After looking over it, I believe whenever the player levels up, or logs in.
Call..
 Ranking(src)
In response to Flame Sage
Flame Sage wrote:
It SEEMS like you didn't make this yourself, seeing as how you do not know how to use it.

yep, you're right there, I saw this in a demo before =P.

O-matic
In response to O-matic
How can i fix it if my game doesnt have a leveling system in it but just has a powerlevel
In response to Govegtos
change all the 'level' vars to the powerlevel vars. its simple.

O-matic
In response to O-matic
Correct. Also, when the verb to call the scoreboard is executed, use a loop to rank everyone, to display accurate data. Only way I can think of to do it without having a looping proc continually running, which can be annoying. Something like this should work.

mob/verb/Scoreboard()
for(var/mob/M in world)
Ranking(M)
Scoreboard()


You'll have to tab that, and I'm not sure that Scoreboard() is the correct proc to call, but that's how it would look like.
Govegtos wrote:
Ive code this up myself and i get this error for some reason
[CODE]
Got any reasons why its doing this?


Well yeah, because you said you "code it up" but you didn't. You stole it from Raekwon, just like you stole the zeta rip you are using. Most likely there is a very small portion that you created.
You took an unworking demo of Raekwon's (hub://RaeKwon.ScoreboardDemo), you claimed it as your own, and you're asking us to fix it for you.

Did you know that claiming somebody else's copyrighted work to be your own is illegal? Please never do that again.
In response to Wizkidd0123
Wizzie, he won't stop. We already discussed this awhile ago. He said he didn't care.
In response to Ol' Yeller
eventually the BYONDStaff will take action against him. Until then, we can ignore him.
In response to Jamesburrow
hey i get this error

scoreboard.dm:3:error:M:undefined var


How can i fix it here line 3

   Ranking(M)
In response to Govegtos
Look up defining vars in the DM ref.