$$loop row as totaltype index as totaltypeindex select * from %%table%%$$
$$openfile %%table%%_%%totaltype.id%%.html$$
$$messagecentrekey="Top%%table%%%%totaltype.id%%"$$
$$include menu.html$$
| $$title$$:$$totaltype.realname$$ |
$$if (totaltype.image !EQUALS "")$$ |
$$endif$$
| # |
Name |
Kills |
Deaths |
Suicides |
Team Kills |
Kill % |
$$totalkills=0$$
$$loop row as playertotal index as playertotalindex select sum(kills) as totalkills from view_killtotal%%suffix%% where itemindex='%%totaltype.idx%%'$$
$$totalkills=playertotal.totalkills$$
$$endloop$$
$$firstrow="Y"$$$$loop row as playertotal index as playertotalindex select *,coalesce((cast((kills * 100.0 ) as float)/%%totalkills%%.0),0.0) as percentage from view_killtotal%%suffix%% where itemindex='%%totaltype.idx%%' order by kills desc limit %%MAXTOTALLISTPLAYERS%%$$
$$if (firstrow EQUALS "Y")$$
$$firstrow="N"$$
$$MessageCentre(messagecentrekey,playertotal.name,playertotal.kills)$$
$$endif$$
| $$playertotalindex$$ | $$tablename="playerdataavatars"$$$$playerdataplayerindex=playertotal.playerindex$$$$include playerprofilecomponent.html$$
$$colouredtext2html(playertotal.name)$$$$if (playerdataavatars !EQUALS "")$$
$$endif$$ |
$$playertotal.kills$$ |
$$playertotal.deaths$$ |
$$playertotal.suicides$$ |
$$playertotal.teamkills$$ |
$$formatfloat("%.2f",playertotal.percentage)$$% |
$$endloop playertotal$$
$$closefile$$
$$endloop totaltype$$