To start with, I'd make it so your code doesn't look like copied and pasted snippedts from the 20-liners, please INDENT your code!!
In trying to look over your code, it was so hard to read, that I went through and properly indented everything and put some things in subroutines. Hopefully this will give you a good idea on how to organize your code so you know what's going on.
Since you were wondering about how I made my menu, I'll give you a brief explanation. I made some images and then textured some planes with my menu images. I then ghosted all the menu images. When the mouse is over a menu option, the ghosting for it is turned off. I'll leave it to you to figure out how to implement this, as my code for my menu is approaching 1000 lines, and it isn't near finished yet.

(Most of that code is for all the menu options you can set.)
Now, here is your cleaned up code.
load sound "feur frei.wav",100
play sound 100
set sound volume 100,10
load bitmap "gamename.bmp",0
set current bitmap 0
a=1
menu:
do
text 180,275,"new Game"
if mousex()>=180 and mousex()<=255 and mousey()>=275 and mousey()<=275+text height("new Game")
ink rgb(0,0,200),0
if mouseclick()=1
exit
gosub game
endif
else
ink rgb(0,0,200),0
endif
text 325,275,"Options"
if mousex()>=325 and mousex()<=425 and mousey()>=275 and mousey()<=275+text height("Options")
ink rgb(0,0,200),0
if mouseclick()=1
d=1
gosub optionsgame
endif
else
ink rgb(0,0,200),0
endif
text 450,275,"quit"
if mousex()>=450 and mousex()<=575 and mousey()>=275 and mousey()<=275+text height("quit")
ink rgb(0,0,200),0
if mouseclick()=1
end
endif
else
ink rgb(0,0,200),0
endif
sync
loop
return
optionsgame:
if d=1
gosub options
else
goto game
endif
return
options:
if a=1
print "game options:";
print " controls";
print " credits" : a=2
endif
return
game:
cls
set sound volume 100,10
wait 400
set sound volume 100,5
wait 400
set sound volume 100,0
wait 400
load bitmap "new menuscreen.bmp",0
set current bitmap 0
do
text 500,430,"begin"
if mousex()>=500 and mousex()<=540 and mousey()>=430 and mousey()<=432+text height("begin")
ink rgb(0,200,0),0
if mouseclick()=1
goto StartGame
endif
else
ink rgb(0,0,200),0
endif
sync
loop
`****************************Begin Game****************************
StartGame:
load object "steves map.x",123
position object 123,3000,5500,5500
position camera 3000,5550,5500
Sync On
Sync Rate 40
Fog on
Fog distance 5500
Fog color RGB(128,128,128)
backdrop on
Color Backdrop RGB(128,128,128)
hide mouse
set camera range 1,100000
load image "target1.bmp",1
load image "target2.bmp",2
for x=200 to 201
make object plain x,1,2
scale object x,15,75,100
next x
position object 200,0,-1,60
position object 201,0,-1,60
zrotate object 201,90
lock object on 200
lock object on 201
texture object 200,1
texture object 201,2
gosub _LoadBullets:
rem load gun
load object "h-pistol-static.x",21
set object collision on 21
xrotate object 21,5
yrotate object 21,10
fix object pivot 21
position object 21,4,-3.9,7
scale object 21,2800,2200,3200
lock object on 21
rem load game sounds and music
load sound "shoot.wav",7
load sound "reload.wav",13
load image "black.bmp",101
make object plain 500,1,4
position object 500,-1.7,-2.5,2
lock object on 500
texture object 500,101
position camera 3000,5750,5500
`Dimension the bullet arrays and setup the variables so the gun works properly
Dim BulletActive(5)
Dim BulletPos(6)
True=1:False=0
ammo=7
clips=10
Mode=1
`******************************************************
`*********************MAIN LOOP*************************
`*******************************************************
do
gosub _CheckBullet
gosub _HandleBullets
gosub _CheckCamera
gosub _MouseLook
gosub _CameraMove
gosub _SelectGun
floor=object position y(123)+280
if gun<2 then shoot=0
if gun>1 then shoot=1
if gun>4 then shoot=0
dec shootwait
`****What are you hiding these objects for every loop? I don't know what they are, so I left the code here
`Hopefully, you will know what to do with it.
for i=1 to 10
hide object 21
next i
if gun=2 then show object 21
if gun=1 then center text 35,400,"knife"
if rot>15 then rot=15
if rot<0 then rot=0
xrotate object 21,rot
rot=rot-3
Sync
loop
_LoadBullets:
for bul = 10 to 15
make object sphere bul,3
color object bul,RGB(50,50,50)
`CollisionTypePro(bul,Type_Bullet)
`SetObjRadiusPro(bul,3.0,3.0,3.0)
hide object bul
next bul
return
_CheckBullet:
bullet_time=bullet_time+1
if Bullet_Time=5
Bullet_Fire=true
Bullet_Time=0
else
Bullet_Fire=false
endif
if Bullet_Fire = False
Bullet_time=bullet_time+1
if Bullet_Time=5
Bullet_Fire=true
Bullet_Time=0
endif
endif
return
_HandleBullets:
if shoot=1
rem Fires Bullets
ink rgb(200,205,200),1
if clips>0 and ammo=0
hide object 21
play sound 13
wait 700
clips=clips-1
ammo=ammo+7
endif
if gun=2 then center text 25,375,""+str$(clips)
if gun=2 then center text 40,375,""+str$(ammo)
if gun=2 and ammo=0 then stop sound 7
if gun=2 then center text 35,400,"colt.45"
if mouseclick()=1>0 and mode = 1 and ammo > 0 and Bullet_Fire = true
inc Bullet_Num, 1
if Bullet_Num = 7 then Bullet_Num = 1
BulletActive(Bullet_Num-1)=1
Bullet_Current = (Bullet_Num - 1) + 10
Bullet_Move = True
show object bullet_current
position object Bullet_Current, camera position x(), camera position y(), camera position z()
set object to camera orientation Bullet_Current
bulletpos(Bullet_Num) = 0
hide object bullet_current
play sound 7
endif
endif
rem Moves Bullets
if Bullet_Move = true
for x = 10 to 15
if BulletActive(x-10)=1
move object x, 100
BulletPos(x-9)=BulletPos(x-9)+50
endif
if bulletPos(x-9)>=1200
hide object x
BulletActive(x-10)=0
BulletPos(x-9)=0
endif
next x
endif
return
_CheckCamera:
Rem stops the camera looking too far up or down
if CameraAngleX# > 90 and CameraAngleX# > 0 and CameraAngleX# < 200
CameraAngleX# = 90
Else
if CameraAngleX# < 270 and CameraAngleX# < 360 and CameraAngleX# > 200
CameraAngleX# = 270
Endif
Endif
return
_MouseLook:
rem mouselook
OldCamAngleY# = CameraAngleY#
OldCamAngleX# = CameraAngleX#
CameraAngleY# = WrapValue(CameraAngleY#+MousemoveX()*0.2)
CameraAngleX# = WrapValue(CameraAngleX#+MousemoveY()*0.2)
return
_CameraMove:
Rem Control input for camera
if inkey$()="w"
move camera 70
position camera camera position x(),floor,camera position z()
endif
if inkey$()="s"
move camera -70
position camera camera position x(),floor,camera position z()
endif
Yrotate camera CurveAngle(CameraAngleY#,OldCamAngleY#,24)
Xrotate camera CurveAngle(CameraAngleX#,OldCamAngleX#,24)
return
_SelectGun:
rem press number keys for next gun
if inkey$()="0" then gun=0
if inkey$()="1" then gun=1
if inkey$()="2" then gun=2
if inkey$()="3" then gun=0
if inkey$()="4" then gun=0
if inkey$()="5" then gun=0
if inkey$()="6" then gun=0
if inkey$()="7" then gun=0
if inkey$()="8" then gun=0
if inkey$()="9" then gun=0
return
There was one part of your code I didn't understand, and that was in the main loop where you're hiding object 21 ten times per loop.
Quote: " for i=1 to 10
hide object 21
next i
"
If you need to hide objects 1 through ten, change your "hide object 21" line to "hide object i"
Anyway, I hope this helps you understand code organization. If you want people to help you, you need good, clean, organized code.
P.S. I don't want to come off sounding harsh or anything; I just want to help you learn.