$$if (%%sortkey%%allowed !EQUALS "N")$$
$$openfile playerlist_%%sortkey%%.html$$
$$include menu.include$$
<title>CoD2 Leaderboard</title>

<br>
<br>

<table border=0 class=nameplate align=center>
<td width=298 height=50 background="general/nameplate.jpg">
<div align="center">$$colouredtext2html(title)$$</div></td>

</table>
	
<br>

<table align=center cellspacing=0 border=0 class=style2 width=1024px>
<tr align=center>
</tr>

<br>

<td>
<table align=center border=0 cellspacing=1 class=style2 width=1024px>	
<tr id="ignore">
<th height=27px width=15px>#</th>
<th width=180px>Player</th>
$$if (killsallowed !EQUALS "N")$$<th width=40px><a href="playerlist_kills.html">Kills</a></th>$$endif$$
$$if (deathsallowed !EQUALS "N")$$<th><a href="playerlist_deaths.html">Deaths</a></th>$$endif$$
$$if (ratioallowed !EQUALS "N")$$<th><a href="playerlist_ratio.html">Ratio</a></th>$$endif$$
$$if (teamkillsallowed !EQUALS "N")$$<th><a href="playerlist_teamkills.html">Team<br>Kills</a></th>$$endif$$
$$if (suicidesallowed !EQUALS "N")$$<th><a href="playerlist_suicides.html">Suicides</a></th>$$endif$$
$$if (skillweightedallowed !EQUALS "N")$$<th><a href="playerlist_skillweighted.html">Skill<br>Weighted</a></th>$$endif$$
$$if (scoreweightedallowed !EQUALS "N")$$<th><a href="playerlist_scoreweighted.html">Score<br>Weighted</a></th>$$endif$$
$$if (skillallowed !EQUALS "N")$$<th><a href="playerlist_skill.html">Skill</a></th>$$endif$$
$$if (scoreallowed !EQUALS "N")$$<th><a href="playerlist_score.html">Score</a></th>$$endif$$
$$if (longestkillstreakallowed !EQUALS "N")$$<th><a href="playerlist_longestkillstreak.html">Kill<br>Streak</a></th>$$endif$$
$$if (longestdeathstreakallowed !EQUALS "N")$$<th><a href="playerlist_longestdeathstreak.html">Death<br>Streak</a></th>$$endif$$

$$if (roundsallowed !EQUALS "N")$$<th><a href="playerlist_rounds.html">Rounds</a></th>$$endif$$
$$if (durationallowed !EQUALS "N")$$<th><a href="playerlist_duration.html">Time<br>Played</a></th>$$endif$$
</tr>
$$firstrow="Y"$$
$$playerdisplaydropped="N"$$
$$loop row as player index as playerindex select *,coalesce(cast(kills as float)/cast(deaths as float),kills) as ratio from player where dropped='N' order by %%sortkey%% desc limit %%MAXPLAYERLISTENTRIES%%$$
$$if (playerindex EQUALS "1")$$
	$$if (sortkey EQUALS "duration")$$
		$$MessageCentre(messagecentrekey,player.name,formatduration("%H:%M:%S",player.%%sortkey%%))$$
	$$else$$
		$$if ((sortkey EQUALS "score") OR (sortkey EQUALS "skill"))$$
			$$MessageCentre(messagecentrekey,player.name,formatfloat("%.0f",player.%%sortkey%%))$$
		$$else$$
			$$if (((sortkey EQUALS "scoreweighted") OR (sortkey EQUALS "skillweighted")) OR (sortkey EQUALS "ratio"))$$
				$$MessageCentre(messagecentrekey,player.name,formatfloat("%.2f",player.%%sortkey%%))$$
			$$else$$
				$$MessageCentre(messagecentrekey,player.name,player.%%sortkey%%)$$
			$$endif$$
		$$endif$$
	$$endif$$
$$endif$$
<tr onMouseover="changeto(event, '494848')" onMouseout="changeback(event, '2f2f2f')" align=center>
<th width=15px height=27px align="center">$$playerindex$$</th>
<td align=left><b>
$$playerdisplayname=player.name$$
$$playerdataplayerindex=player.playerindex$$
$$include playerdisplay.include$$
</b></td>
$$if (killsallowed !EQUALS "N")$$<td>$$player.kills$$</td>$$endif$$
$$if (deathsallowed !EQUALS "N")$$<td>$$player.deaths$$</td>$$endif$$
$$if (ratioallowed !EQUALS "N")$$<td>$$formatfloat("%.2f",player.ratio)$$</td>$$endif$$
$$if (teamkillsallowed !EQUALS "N")$$<td>$$player.teamkills$$</td>$$endif$$
$$if (suicidesallowed !EQUALS "N")$$<td>$$player.suicides$$</td>$$endif$$
$$if (skillweightedallowed !EQUALS "N")$$<td>$$formatfloat("%.2f",player.skillweighted)$$</td>$$endif$$
$$if (scoreweightedallowed !EQUALS "N")$$<td>$$formatfloat("%.2f",player.scoreweighted)$$</td>$$endif$$
$$if (skillallowed !EQUALS "N")$$<td>$$formatfloat("%.0f",player.skill)$$</td>$$endif$$
$$if (scoreallowed !EQUALS "N")$$<td>$$formatfloat("%.0f",player.score)$$</td>$$endif$$
$$if (longestkillstreakallowed !EQUALS "N")$$<td>$$player.longestkillstreak$$</td>$$endif$$
$$if (longestdeathstreakallowed !EQUALS "N")$$<td>$$player.longestdeathstreak$$</td>$$endif$$

$$if (roundsallowed !EQUALS "N")$$<td>$$player.rounds$$</td>$$endif$$
$$if (durationallowed !EQUALS "N")$$<td>$$formatduration("%H:%M:%S",player.duration)$$</td>$$endif$$
</tr>
$$endloop$$
</table>
</th>
</tr>
</table>
$$closefile$$
$$endif$$
