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 / Function for timeing something.

Author
Message
Eminent
14
Years of Service
User Offline
Joined: 15th Jul 2010
Location:
Posted: 8th Sep 2010 00:20
I want to make it so that person can only fire after a second or so. Is there a command for this?
I want something like this(Not real code)

Do
Time = TimeCommand
if Time = 1000(1sec)
fire()
endif
loop


Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 8th Sep 2010 00:56 Edited at: 8th Sep 2010 00:56
Have a look at the TIMER() command. It record how many milliseconds it has been since the computer was turned on. If you record this time each loop, and then find the difference between the time this loop and the time last loop, then you can get the number of milliseconds that have passed. Here's an example of a 1 second delay:



The words "A second has passed" should print once each second.


Guns, cinematics, stealth, items and more!

Login to post a reply

Server time is: 2024-09-28 22:25:41
Your offset time is: 2024-09-28 22:25:41