KWo, why to you to not make so on/off flashlight so: "pEdict->v.impulse 100;" ?
I personally for YaPB bot have made so:
PHP Code:
void Bot::SwitchFlashlight (bool on)
{
// this function switches on/off the flashlight of a bot.
if
(
m_isReloading ||
strncmp ("zombie", GetModelName (GetEntity ()), 6) == 0 ||
(
(on && (!g_botVar[Variable_FlashLight]->GetBool () || (pev->effects & EF_DIMLIGHT) || m_flashLightBattery == 0 || !IsAlive (GetEntity ()))) ||
(!on && !(pev->effects & EF_DIMLIGHT))
)
)
return;
// switch on/off the flash light
pev->impulse = 100;
}
It would solve some problems with flashlight battery & else...
& P.S. googles is written goggles
