ok... so now here's my code.
Rem Setup sync
Sync On
Sync Rate 30
autocam off
Rem make matrix
Make matrix 1,10000,10000,20,20
position matrix 1,-500,-200,-500
Rem texture matrix
Load image "sand.bmp",1
Prepare matrix texture 1,1,2,2
Rem Randomize the matrix
randomize matrix 1,250
Rem Place random texture on each matrix tile
For x = 0 to 19
For z = 0 to 19
t = rnd(3)+1
Set Matrix Tile 1,x,z,t
Next z
Next x
Rem Update the changes to the matrix
update matrix 1
Rem Make Cubes for reference
For x = 1 to 5
Make object cube x,100
Position object x,Rnd(2000),0,Rnd(2000)
Set object collision to boxes x
Next x
Rem make the m4a1 machine gun
load object "m4a1.3ds",10
position object 10,500,-200,500
scale object 10,25,25,25
set object collision to boxes 10
rem load crosshair
load object "crosshair.3ds",3
set object rotation zyx 3: set object rotation zyx 10
Rem Main loop
Do
cursorheight#=cursorheight#-mousemovey()
angle#=wrapvalue(angle#+mousemovex())
position object 3, object position x(10)+cos(angle#)*200.0, cursorheight#, object position z(10)+sin(angle#)*200.0
point camera object position x(3),object position y(3),object position z(3)
Rem Store Object angle
aY#= object angle y(10)
rem store angle of crosshair
chY#= object angle y(3)
Rem Control input for camera
If Upkey()=1
XTest# = Newxvalue(X#,aY#,25)
ZTest# = Newzvalue(Z#,aY#,25)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
Move object 10,25
Endif
Endif
If downkey()=1
XTest# = Newxvalue(X#,aY#,20)
ZTest# = Newzvalue(Z#,aY#,20)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
Move object 10,-25
Endif
Endif
X# = Object position x(10)
Z# = Object position z(10)
Y# = Get Ground Height(1,X#,Z#)
Position object 10,X#,Y#+1,Z#
position camera X#-30,y#+40,z#-140
position object 3,x#-20,y#,z#+200
yrotate object 3,90
scale object 3,150,150,150
If Leftkey()=1 then position object 10,x#-20,y#,z#
position camera x#-50,y#+40,z#-140
If Rightkey()=1 then position object 10,x#+20,y#,z#
position camera x#-10,y#+40,z#-140
rem limiting the movement
if ay#<45 or ay#>315 then yrotate object 10,aY#
Rem Refresh Screen
Sync
Loop
set object to camera orientation 3
the camera just goes crazy when i move the mouse... are you guys sure you know exactly what i'm trying to do? i'm try to get it so the aiming system is exactly like or very similar to counterstrike/battlefield 1942/call of duty (i think).
what happens in these games is, when u move the mouse, it looks around and the crosshair is ALWAYS IN THE MIDDLE OF THE SCREEN. i just don't know how to do that