Added use button

This commit is contained in:
ineedbots 2021-05-25 16:56:48 -06:00
parent ab612e8ff6
commit 712f2c3a37
2 changed files with 32 additions and 0 deletions

View File

@ -241,6 +241,9 @@ watchGrenadeFire()
{
self waittill( "grenade_fire", nade, weapname );
if (!isDefined(nade))
continue;
if ( weapname == "c4_mp" )
self thread watchC4Thrown(nade);
}
@ -2005,6 +2008,27 @@ smoke(time)
self.bot.issmokingafter = false;
}
/*
Bot will press use for a time.
*/
use(time)
{
self endon("death");
self endon("disconnect");
self notify("bot_use");
self endon("bot_use");
if(!isDefined(time))
time = 0.05;
self botAction("+use");
if(time)
wait time;
self botAction("-use");
}
/*
Bot will fire if true or not.
*/

View File

@ -84,6 +84,14 @@ BotPressADS(time)
self maps\mp\bots\_bot_internal::pressADS(time);
}
/*
Bot presses the use button for time.
*/
BotPressUse(time)
{
self maps\mp\bots\_bot_internal::use(time);
}
/*
Bot presses the frag button for time.
*/