I just got finished implementing aiming and shooting into my FPS game. I built it off Ruccus's tutorial that bobbel referenced. It's a good resource, but it does have a few issues that I had to modify the code to get rid of.
My FPS is using Dark Physics for collision detection, so I don't know how similar your code is, but for mine, I put a thin box on the floor and positioned the camera on that box, but about 100 units away in the Y direction.
So object 1 is my physics player box, and the code for the camera looks like this.
(inside the DO...LOOP commands)
POSITION CAMERA OBJECT POSITION X(1),OBJECT POSITION Y(1)+100,OBJECT POSITION Z(1)
I then made a small cube (object number 9998) and placed it exactly where the camera is:
MAKE OBJECT CUBE 9998,2
(this part is inside the DO...LOOP commands)
POSITION OBJECT 9998, CAMERA POSITION X(),CAMERA POSITION Y(),CAMERA POSITION Z()
I then have object 9998 rotate to match the rotation of the camera on both the X and Y axis.
Here's my mouse aiming code, with aiming constraints and the code to rotate object 9998.
CAMY#=CAMY#+MOUSEMOVEX()*.2
CAMX#=CAMX#+MOUSEMOVEY()*.2
YROTATE CAMERA CAMY#
XROTATE CAMERA CAMX#
YROTATE OBJECT 1,CAMY#
YROTATE OBJECT 9998,CAMY#
XROTATE OBJECT 9998,CAMX#
IF WRAPVALUE(CAMERA ANGLE X(0))>60 AND WRAPVALUE(CAMERA ANGLE X(0))<180 then XROTATE CAMERA 0,60
IF WRAPVALUE(CAMERA ANGLE X(0))>180 AND WRAPVALUE(CAMERA ANGLE X(0))<280 then XROTATE CAMERA 0,280
IF WRAPVALUE(OBJECT ANGLE X(9998))>60 AND WRAPVALUE(OBJECT ANGLE X(9998))<180 then XROTATE OBJECT 9998,60
IF WRAPVALUE(OBJECT ANGLE X(9998))>180 AND WRAPVALUE(OBJECT ANGLE X(9998))<280 then XROTATE OBJECT 9998,280
Then you attach a limb to object 9998, and use raycasting to check for intersection.
MAKE OBJECT SPHERE 9999,2
MAKE MESH FROM OBJECT 1,9999
DELETE OBJECT 9999
ADD LIMB 9998,1,1
OFFSET LIMB 9998,1,0,0,500
HIDE LIMB 9998,1
Then, if there is an intersection, and the fire button is being pressed, you put in you killing code:
IF MOUSECLICK()=1 AND INTERSECT OBJECT ((enemy number goes here), LIMB POSITION X(9998,1), LIMB POSITION Y(9998,1), LIMB POSITION Z(9998,1), OBJECT POSITION X(9998),OBJECT POSITION Y(9998), OBJECT POSITION Z(9998))>0
(Your enemy killing code goes here)
ENDIF
The reason I had to modify Ruccus's code like that, is because my physics player box can only rotate to the left and right, so I would only be able to aim straight ahead with the code he wrote. So I made another box exactly where the camera is and made it match the camera's rotation. I gave that object a limb, and since limbs match the movement and rotation of their parent object, and the parent object is always where the camera is, it essentially is a limb coming straight out of the camera.
Note: if you want to see that it works without having to code in an enemy to kill, change the offset limb from 500 to 50, and delete the hide limb command, you can now see the limb constantly 50 units in front of your camera.
I hope that helps you.