Check when player fires weapon, or check if he is doing +attack

I want it so when I throw a hl2 grenade, there is a chance that a certain sound file will play. The problem is I don’t know a hook (this is for a gamemode, and its a hl2 weapon anyway not a swep) that can detect when a certain weapon is fired, or even when a console command is triggered such as +attack. So how can I do this?

KeyPress hook.



hook.Add("KeyPress", "grenadecheck", function(ply, key)

    if (key == IN_ATTACK and ply:GetActiveWeapon():GetClass() == "weapon_grenade") then
        --do something
    end

end)