Use DeathMsg. I started out making comments on your code but it got messy since there are a ton of things wrong. I removed things that were not needed, including getting the player names.
PHP Code:
register_event( "DeathMsg" , "DeathMsg" , "a" , "4=knife" , "1>0" );
public DeathMsg()
{
new iKiller = read_data( 1 );
new iVictim = read_data( 2 );
pdData[iVictim][Deaths]++;
pdData[iKiller][Kills]++;
pdData[iKiller][Headshot] += read_data( 3 );
}
__________________