Should work, typed out of my brain, but you can only get the one with the most or lowest deaths.
If there are players with same death count the one with the higher ID will be the result.
Could be done for more positions too, but would get abit complex then..
// Pos=1: most deaths; Pos=2: lowest deaths;
function GetMostKilled(Pos, Team: byte): byte;
var deaths: integer;
begin
Result := 0;
Deaths := iif(Pos=1, -1, 9000); // If we want the one with the lowest and would start at 0 deaths result would be always 0, thats why I put that
for i := 1 to 32 do
if (GetPlayerStat(i, 'Active') = true) and (GetPlayerStat(i, 'Team') = Team) then
if ((GetPlayerStat(i, 'Deaths') > Deaths) and (Pos = 1)) or ((GetPlayerStat(i, 'Deaths') < Deaths) and (Pos = 2)) then begin
Result := i;
Deaths := GetPlayerStat(i, 'Deaths');
end;
end;
Have fun with it ;P