;Requires Ply's Mod V1.07+
;Artificial Intelligence Script
;Header
desc = Fully Custumisable car with Gears, Brakes, Acceleration, Steering and More
:state=0:makecamera=carcam
:state=0:offsetcamy=carcam 100,offsetcamfore=carcam= -200
:state=0:dimvar=gear,dimvar=topspeed,dimvar=accel,dimvar=vel,dimvar=angle,state=2,dimvar=TempX, dimvar=TempY
:state=2:plrdistwithin=100,plrusingaction=1:startmenu,viewcam=carcam,plrcoloff,loopsound=audiobank/atmos/motorhum.wav,animate=1
:state=1:PlrLives,hudunshow=PlrLivesNum,hudunshow=PlrHealth,hudunshow=PlrHealthNum,hudunshow=GunPic,hudunshow=PlrAmmo,hudunshow=PlrArmor,hudunshow=PlrArmorNum,hudunshow=PlrMoney,hudunshow=PlrMoneyNum,cameraposx=carcam $EPX,cameraposy=caram $EPY,cameraposz=carcam $EPZ,state=1
;ok now that everything is set up and we are in the car, We need to add movement to the car, Add some Gears and some Steering
:state=1,keypressed=30:addvar=angle 5,cameraangy=HumveeCam %angle
:state=1,keypressed=32:addvar=angle -5,cameraangy=HumveeCam %angle
:state=1:entityangley=%angle
;thats the steering done, Now to set the gear, We will start in gear 1 and you must press X to go up gears and Y to go down, C is clutch and you must release the accelerator
:state=1:setvar=gear 1
:state=1:keypressed=45,keypressed=46,keypressed=17 0:addvar=gear 1
:state=1keypressed=44,keypressed=46,keypressed=17 0:addvar=gear -1
:state=1,varless=gear 0:setvar=gear 0
:state=1,vargreater=gear 5,setvar=gear 5
;Now thats our gears created, now we need to set the acceleration and limits for each gear
:state=1,varequal=gear 0:setvar=accel 0,setvar= 0
:state=1,varequal=gear 1:setvar=accel 7,setvar=topspeed 20
:state=1,varequal=gear 2:setvar=accel 12,setvar=topspeed 40
:state=1,varequal=gear 3:setvar=accel 17,setvar=topspeed 60
:state=1,varequal=gear 4:setvar=accel 20,setvar=topspeed 80
:state=1,varequal=gear 5:setvar=accel 10,setvar=topspeed 120
;Now with the limits set, we need to make sure, that if the player were to be going at 120 mph , that they could not go to gear 1 and maintain that speed
:state=1,vargreater=vel %topspeed:setvar=vel %topspeed,subvar=vel 1
;Now we need to Give the vehicle acceleration
:state=1,vargreater=gear 0,keypressed=17:addvar=vel %accel
;Now give the vehicle Reverse
:state=1,keypressed=17,varequal=gear 0:movefore=-2
;Now We need to give the Vehicle fowards movement
:state=1:movefore=%vel
;Give the vehicle Brakes
:state=1:dimvar=brakes,setvar=brakes 10
:state=1:keypressed=31:subvar=vel %brakes
;Now, Take this section from ply's version to allow the player to get out of the car
;///// Restore normal FPS Cam when "G" is pressed \\\\\
;///// Need to restore player control with "stopmenu" and view the normal camera and stop motor sound \\\\\
:state=1,keypressed=34 1:state=4
;///// Show the Player HUDs again \\\\\
:state=4:hudshow=PlrLives,hudshow=PlrLivesNum,hudshow=PlrHealth,hudshow=PlrHealthNum,hudshow=GunPic,hudshow=PlrAmmo,hudshow=PlrArmor,hudshow=PlrArmorNum,hudshow=PlrMoney,hudshow=PlrMoneyNum
;///// Position Player outside of driver door \\\\\
:state=4:cameraposx=carcam $EPX,cameraposy=carcam $EPY,cameraposz=carcam $EPZ
:state=4:setvar=TempY $EAY,subvar=TempY 90
:state=4:cameraangx=carcam 0,cameraangy=carcam %TempY,cameraangz=carcam 0
:state=4:movecam=HumveeCam 70
:state=4:setvar=TempX $CPX_carcam,cameraposx=0 %TempX
:state=4:setvar=TempX $CPY_carcam,,addvar=TempX 100,cameraposy=0 %TempX
:state=4:setvar=TempX $CPZ_carcam,,cameraposz=0 %TempX
:state=4:addvar=TempY 90,cameraangy=carcam, %TempY
:state=4:cameraangy=0 %TempY
:state=4:stopmenu,viewcam=0,plrcolon,stopsound,state=1
;End of Script
Ok heres my problem. I have made this script to work for the humvee, with gears (Yes I know you could just put it in gear 5) However when i have a humvee with this script, I just fall through the floor and I move the camera at all. I cant see what is wrong with it so im wondering, ply, anyone, Do you know whats wrong with it?