// ****************** Weapons
var statsx=315;
var statsy=yloc-2;
var statss=8;
var statsl=9;
// get weapons list sorted by number of kills
var
bestweaps=getSortedList(p.stats.weapons,'kills');
// find first pistol in sorted weapons list
pcount=0;
wcount=0;
for (n in bestweaps) {
if (bestweaps[n].category!='Pistols' && wcount!=3) {
wcount++;
if (wcount==1) weapy=statsy;
else if (wcount==2) weapy=statsy+36;
else if (wcount==3) weapy=statsy+72;
image({x:statsx, y:weapy-9, file:bestweaps[n].img, w:74, h:45});
wtext='';
wtext=wcount+'. '+bestweaps[n].name;
invshadowtext({x:statsx, y:weapy, size:6, text:wtext});
wtext=bestweaps[n].kills + ' kills';
text({x:statsx+129, y:weapy+10, size:6, text:wtext, align:'right'});
wtext=nf(bestweaps[n].hits/bestweaps[n].shots*100,
1) + '% Acc';
text({x:statsx+129, y:weapy+19, size:6, text:wtext, align:'right', color:'ffffff'});
} else if (pcount==0 && bestweaps[n].category=='Pistols') {
//text({x:330, y:54, size:6, text:bestweaps[n].name, align:'center'});
//image({x:293, y:53, file:bestweaps[n].img, w:71, h:43});
var ptext='';
ptext=bestweaps[n].kills + ' kills';
//text({x:330, y:97, size:6, text:ptext, align:'center'});
ptext=nf(bestweaps[n].hits/bestweaps[n].shots*100,
1) + '% Acc.';
//text({x:330, y:105, size:6, color:'ffffff', text:ptext, align:'center'});
pcount++;;
}
else if (pcount==1 && wcount==3) break;
};