cs_get_weapon_id accepts WEAPON entities, not players, use the other method, get_user_weapon().
Also be warned, if someone is killed by a grenade, you can get verry bad results, you should get a pev value from the victim indicating damage type, I don't remember which... pev_dmg.. something.