$$loop row as stat index as statindex select count(*) as killcount,id,playerclass,realname,image,(select count(*) from killdata as subkilldata where killdata.playerclass=subkilldata.playerclass and killtype='SUICIDE') as suicidecount,(select count(*) from killdata as subkilldata where killdata.playerclass=subkilldata.playerclass and killtype='TEAMKILL') as teamkillcount from killdata,class where killtype='KILL' and class.idx=killdata.playerclass group by playerclass order by killcount desc limit %%MAXMAINPAGECLASSES%%$$ $$endloop stat$$
# Class Kills Team
Kills
Suicides
$$statindex$$ $$stat.realname$$$$if (stat.image !EQUALS "")$$
$$endif$$
$$stat.killcount$$ $$stat.teamkillcount$$ $$stat.suicidecount$$