I've got a gun into my game and i've got it setup so when you are just standing a idle animation plays, same for walking and sprinting but I can't seem to get the reloading and fire weapon working. Here is the code for the animtions and weapon load :
`Load Weapons ======================
`G3
Load object "Data/Models/Weapons/G3/HUD.x",100
load effect "Data\Shaders\Weapons.fx",10,1
set object effect 100,10
set object speed 100,40
loop object 100,40,85
rotate object 100,0,180,0
lock object on 100 `Gunna change this after getting important parts of game done
position object 100,4,-2,0
`Weapon Settings - IN LOOP
if mouseclick()=2 then ADS=1
if mouseclick()=0 then ADS=0
if ADS=1
position object 100,-4.3,0.9,-7
rotate object 100,1,181,0
runon#=0.2
set camera fov 70
else
ADS=0
set camera fov 75
ENDIF
if ADS=0
position object 100,1,-2,0
rotate object 100,0,180,0
else
ADS=1
ENDIF
if KEYSTATE(46)=1 then Crouch=1
if KEYSTATE(46)=0 then Crouch=0
if crouch=1
set object speed 100,20
radius# = 25.0
else
set object speed 100,40
radius#= 40.5
crouch=0
`Sprint keystates (Wouldn't work without function for some reason)
if KEYSTATE(42)=1 and KEYSTATE(17)=1 then sprint()
if keystate(42)=1 and KEYSTATE(32)=1 then sprint()
if keystate(42)=1 and KEYSTATE(30)=1 then sprint()
if keystate(4)=1 and KEYSTATE(31) =1 then sprint()
function sprint()
rotate object 100,-20,180,0
ENDFUNCTION
Now for the reloading and firing animations i've tried flags and functions but either work, it just changes to the first frame of the animations.
Thx for any help
Windows 7, Amd Athlon 7750 Black Editon (64 bit,3ghz + Dual Core), ATI Readon HD 4870 1gb Edition, 4gb Ram.