AHHH!!! Sorry, the code isn't correct! (should be in the code brackets...)
Here is the real thing...
rem Draw 2D-details
SUB_draw_2d:
rem Draw crosshairs, only when not in nightvision
if nightvision = 0
rem Position and rotate controller object
position object 30,object position x(11),object position y(11),object position z(11)
xrotate object 30,camera angle x()
yrotate object 30,angle
collided_cross=0
rem Run a forloop and move it forward a little bit
rem at a time and check whether it's colliding or not
for t=1 to 25
rem Move controller object
move object 30,200
rem Check collision
if object position y(30)<get ground height(1,object position x(30),object position z(30)) or collision(object position x(30),object position y(30),object position z(30),10.0)
rem If colliding, then position the flexible crosshair
position object 31,object position x(30),object position y(30),object position z(30)
point object 31,camera position x(),camera position y(),camera position z()
move object 31,(t*50)-10
collided_cross=1
exit
endif
next t
rem If it doesn't collide with anything...
if collided_cross=0
rem then position at largest distance
position object 31,object position x(30),object position y(30),object position z(30)
point object 31,camera position x(),camera position y(),camera position z()
move object 31,4950
endif
position object 30,object position x(11),object position y(11),object position z(11)
xrotate object 30,camera angle x()
yrotate object 30,angle
move object 30,5000
position object 32,object position x(30),object position y(30),object position z(30)
point object 32,camera position x(),camera position y(),camera position z()
move object 32,4950
endif
return
I didn't steal it!