.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   Duck for seconds ? (http://forums.bots-united.com/showthread.php?t=974)

slash-evil 04-03-2004 01:00

Duck for seconds ?
 
As the title says , could someone give me an example of how to make a bot duck for about 5 seconds ?

is it like this ?????

Code:

pEdict->v.button |= IN_DUCK+5.0<gpGlobals->time)

Lazy 04-03-2004 01:35

Re: Duck for seconds ?
 
Actually, no.
Its nowhere close to that.

Make a float variable, lets say flFinishDuckTime...
When you want them to hold down the key set it to gpGlobals->time + 5.0 or whatever time measurement you want.

Where the code for holding down buttons normally goes add something like this...

if gpGlobals->time is below flFinishDuckTime then hold down the IN_DUCK key.

I think that's how it goes, though I still wonder if you thought the line you posted was actually valid.


All times are GMT +2. The time now is 22:56.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.