Sergey is right if you are doing a standard FPS. I was thinking more along the lines of, if you want to be able to go in any direction, like a space sim.
You could swap your code like this:
`Old code
`cx#=wrapvalue(cx#+mousemovey())
`cy#=wrapvalue(cy#+mousemovex())
`x#=curveangle(x#, cx#, 1.5)
`y#=curveangle(y#, cy#, 1.5)
`rotate camera x#, y#, 0
`New code
cx#=wrapvalue(cx#+mousemovey())
cy#=wrapvalue(cy#+mousemovex())
x#=curveangle(x#, cx#, 1.5)
y#=curveangle(y#, cy#, 1.5)
rotate camera 0, 0, 0 //Always reset camera as turn and pitch commands add to the existing rotation
turn camera right cy#
pitch camera up cx#