Hi all.
I got a problem with this function. For some strange reason, the compiler think the "endfunction" command is out of place. Can anyone help me to fix the problem?
rem How to fire and how long the reeloading time is for player one
function WeaponsPlayerOne()
rem Fire the bullet
if keystate(54)=1 and weaponState(1).CantFire=0
weaponState(1).wait0=timer()
weaponState(1).CantFire=1
if weaponUsage(1).weaponName="Cannon"
MakeBulletPlayerOne()
else if weaponUsage(1).weaponName="Ripper"
MakeRipperPlayerOne()
else
endif
endif
rem Time to next bullet
if weaponState(1).CantFire=1
weaponState(1).time=(timer()-weaponState(1).wait0)/10
if weaponState(1).time>=150 then weaponState(1).CantFire=0
endif
endfunction
EDIT:
The function controls how you fire, and how long time it takes to be able to fire the next bullet. The problems came up after I shanged it from
rem How to fire and how long the reeloading time is for player one
function WeaponsPlayerOne()
rem Fire the bullet
if keystate(54)=1 and weaponState(1).CantFire=0
weaponState(1).wait0=timer()
weaponState(1).CantFire=1
MakeBulletPlayerOne()
endif
rem Time to next bullet
if weaponState(1).CantFire=1
weaponState(1).time=(timer()-weaponState(1).wait0)/10
if weaponState(1).time>=150 then weaponState(1).CantFire=0
endif
endfunction
to the code you see above, if it helps.