Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Bullet timer

Author
Message
Bio Hazard
17
Years of Service
User Offline
Joined: 12th Sep 2007
Location: Ununited states
Posted: 20th May 2009 03:18
Hi! i have posted before on a different problem and i ran into another problem. Well not really a problem, more like a question.

I need to make a timer of some sort that makes my gun shoot 30 rounds per 5 seconds.
i know to start it like for bullet = 1 to 30
but after that im completely floored. help please.! thank you.

what is left behind is left behind, but what is ahead might make a difference to whats left behind.
bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 20th May 2009 09:09
i always do that like this



this could be done very much more precisely, but since its a gun shooting ( i think), i think it doesn't have to be very exact

(\__/)
(O.o )
(> < ) This is Bunny. Copy Bunny into your signature to help him on his way to world domination!
Bio Hazard
17
Years of Service
User Offline
Joined: 12th Sep 2007
Location: Ununited states
Posted: 20th May 2009 18:18
Thanks, it's working except for one thing, u have to keep pressing the mouse , ill keep trying to fix but here is my code.
(im working on another project but right now im using ruccus's fps tutorial code)

heres all the code


what is left behind is left behind, but what is ahead might make a difference to whats left behind.
Bio Hazard
17
Years of Service
User Offline
Joined: 12th Sep 2007
Location: Ununited states
Posted: 20th May 2009 18:36
YES!!!! i moved the code around a bir and got it to work




`click the mouse
IF KEYSTATE(19)=0 AND MOUSECLICK()=1
IF Ammo#>0
`bullet delay
if mouseclick()=1 and Timer()-ShootDelay > 5000/30
dec Ammo#
`check to see if it hit
IF OBJECT EXIST(2)=1
IF Ammo#>0 AND INTERSECT OBJECT (2, LIMB POSITION X(1,1), LIMB POSITION Y(1,1), LIMB POSITION Z(1,1), OBJECT POSITION X(1),OBJECT POSITION Y(1), OBJECT POSITION Z(1))>0 THEN DEC EnemyHP#,1
shootdelay = Timer()
ENDIF
ENDIF
ENDIF
Endif
[/code

what is left behind is left behind, but what is ahead might make a difference to whats left behind.
Bio Hazard
17
Years of Service
User Offline
Joined: 12th Sep 2007
Location: Ununited states
Posted: 20th May 2009 18:36
YES!!!! i moved the code around a bir and got it to work




`click the mouse
IF KEYSTATE(19)=0 AND MOUSECLICK()=1
IF Ammo#>0
`bullet delay
if mouseclick()=1 and Timer()-ShootDelay > 5000/30
dec Ammo#
`check to see if it hit
IF OBJECT EXIST(2)=1
IF Ammo#>0 AND INTERSECT OBJECT (2, LIMB POSITION X(1,1), LIMB POSITION Y(1,1), LIMB POSITION Z(1,1), OBJECT POSITION X(1),OBJECT POSITION Y(1), OBJECT POSITION Z(1))>0 THEN DEC EnemyHP#,1
shootdelay = Timer()
ENDIF
ENDIF
ENDIF
Endif
[/code

what is left behind is left behind, but what is ahead might make a difference to whats left behind.
Bio Hazard
17
Years of Service
User Offline
Joined: 12th Sep 2007
Location: Ununited states
Posted: 20th May 2009 19:25
sorry about the double post

what is left behind is left behind, but what is ahead might make a difference to whats left behind.
Encrypto Studios
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: Virginia
Posted: 21st May 2009 00:27
actually that was four! there is an edit button...

this actually helped me too, but just saying

bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 21st May 2009 09:43
btw, that 5000/30 is just a number, you can also pre-calculate it and put it into a variable, that will be easier to change

(\__/)
(O.o )
(> < ) This is Bunny. Copy Bunny into your signature to help him on his way to world domination!
Bio Hazard
17
Years of Service
User Offline
Joined: 12th Sep 2007
Location: Ununited states
Posted: 22nd May 2009 00:07
cool, sounds like ill do that. ^_^ it would be better for debugging!

what is left behind is left behind, but what is ahead might make a difference to whats left behind.

Login to post a reply

Server time is: 2024-09-28 06:28:19
Your offset time is: 2024-09-28 06:28:19