Controlling spread and recoil with mouse?

I guess everyone have atleast once played Counter-Strike… and you probably know you can control the spread of the bullets and the recoil of the weapon by moving your mouse downwards as you shoot. I’ve found a lot of great tutorials online about spread and recoil but none of them covers this subject at all.

It will be hard creating mechanics exactly like in CS, but it should however be possible to script something similiar; have anyone in here done anything like this before and is willing to share their knowledge?

Recoil System changes the pitch and yaw of the camera each shot, making the camera look up and left or right. Pulling the mouse down pitches the camera down, which counteracts the recoil system. That’s really all that’s going on.