Use a variable to store the current highest kill number and current highest player id. Check each players kills against it and if that player had a higher kill number update that variable with his kill# and id. After the loop you will be left with highest kill number and the players id.
Something like this, with the addition of team checks, should work for you. untested.
PHP Code:
MostKills()
{
new iMostKills_id , iMostKills_Num , iMaxPlayers = get_maxplayers();
for ( new i = 1 ; i <= iMaxPlayers ; i++ )
{
if ( Kills[ i ] > iMostKills_Num )
{
iMostKills_Num = Kills[ i ];
iMostKills_id = i;
}
}
if ( iMostKills_id )
{
new szName[ 33 ];
get_user_name( iMostKills_id , szName , charsmax( szName ) );
client_print( 0 , print_chat , "* %s has most kills @ %d!" , szName , iMostKills_Num );
}
}
__________________