Here is one way to do it in vanilla FPSC by Conjured Entertainment. I've used it and it works well.
;Artificial Intelligence Script
;Conjured Entertainment
desc = earthquake exampleb
;Triggers
:state=0:coloff,localvar=9,state=1
:state=1,plrdistwithin=200:sound=audiobank\user\earthquake.ogg,timerstart,state=2
:state=2:associateplayer
:state=2,timergreater=60:timerstart,moveup=4,incvar=1,state=3
;///VARGREATER CONTROLS THE NUMBER OF LOOPS OR LENGTH OF EARTHQUAKE\\\
:state=2,vargreater=40:unassociateplayer,setvar=0,state=4
:state=3,timergreater=50:timerstart,moveup=-4,state=2
:state=4:destroy
;End of Script
Assign that script to a dynamic entity anywhere in the vicinity of where you want to have the camera shake. Make sure the entity is set to "always active". Add your own sound if desired or remove the reference from the script. I used it for an earthquake.
I would assume that to have a shake when the player is hit, you would change the trigger to
shotdamage= or
plrhealthless= instead of
plrdistwithin= and make the duration of the shake much shorter.