I also feel so fucking dumb for not posting the right thing. I thought OP wanted a function that detects a player you almost hit and the distance between the impact and the player, not the distance from the player you just killed...
Here's what you want to do. I also edited my first reply to include this script instead, sorry for the confusion. While I'm at it I included the "more precise" multiplier too since it seems to cause alot of debate for whatever reason.
Step 1 - Add the following in
level.onkillscore = level.onplayerkilled;
level.onplayerkilled = ::onplayerkilled;
Step 2 - Copy the following somewhere in your file :
onPlayerKilled(einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shitloc, psoffsettime, deathanimduration)
thread [[level.onkillscore]](einflictor, attacker, idamage, smeansofdeath, sweapon, vdir, shitloc, psoffsettime, deathanimduration);
// ^ this is here so you can still score normally
attacker iPrintLn("You killed " + self.name + " from " + int(distance(self.origin, attacker.origin)*0.0254) + "m away");