You need to toggle the IN_ATTACK button on and off. If you keep setting it to IN_ATTACK during EVERY frame, it's the same thing as holding the trigger down (which will only fire ONE shot unless you are firing an automatic weapon).
Try something like this...
Code:
if (RANDOM_LONG(1, 100) <= 100) //now 100% because I want to test it
{
pBot->f_duck_time = gpGlobals->time + 1.5;
FakeClientCommand(pEdict, "say", "DUCKING", NULL);
if (RANDOM_LONG(1, 2) == 1)
pEdict->v.button |= IN_ATTACK; // fire the weapon
else
pEdict->v.button = 0; // stop pressing the button
return TRUE;
}
This will cause the IN_ATTACK button to rapidly toggle (randomly) on and off. It's the same sort of thing used in the code that respawns an HPB bot when playing deathmatch.
botman