Locking the camera from moving to far left or right

ive gotten the camera to clamp so it wouldnt go to far up or down but i cant seem to clamp the left or right view. This is also my first time writing code so sorry if its a simple fix.