added dvars

This commit is contained in:
INeedBots 2021-01-22 19:59:28 -06:00
parent 31691c73b8
commit 537911e91a
3 changed files with 38 additions and 2 deletions

View File

@ -98,7 +98,8 @@ bot_give_loadout()
self takeAllWeapons();
self GiveWeapon( "knife_mp" );
if (getDvarInt("bots_play_knife"))
self GiveWeapon( "knife_mp" );
weap = self.pers["bot"]["class_primary"];
if(weap == "")
@ -116,12 +117,23 @@ bot_give_loadout()
if ( self hasPerk( "specialty_extraammo" ) )
self giveMaxAmmo( weap );
if (!getDVarint("bots_play_fire"))
{
self SetWeaponAmmoClip(weap, 0);
self SetWeaponAmmoStock(weap, 0);
}
if(self.pers["bot"]["class_secondary"] != "")
{
self GiveWeapon( self.pers["bot"]["class_secondary"], 0, int( self.pers["bot"]["class_secondary_opts"] ) );
if ( self hasPerk( "specialty_extraammo" ) )
self giveMaxAmmo( self.pers["bot"]["class_secondary"] );
if (!getDVarint("bots_play_fire"))
{
self SetWeaponAmmoClip(self.pers["bot"]["class_secondary"], 0);
self SetWeaponAmmoStock(self.pers["bot"]["class_secondary"], 0);
}
}
self SetActionSlot( 3, "altMode" );

View File

@ -139,11 +139,29 @@ bot_on_spawn()
self.bot_lock_goal = false;
self.help_time = undefined;
self.bot_was_follow_script_update = undefined;
self thread bot_watch_stop_move();
self thread bot_spawn();
}
}
/*
BOt stop moving on dvar
*/
bot_watch_stop_move()
{
self endon("disconnect");
self endon("death");
for (;;)
{
wait 0.05;
if (!getDvarInt("bots_play_move"))
self thread botStopMove(true);
}
}
/*
Fired when the bot is damaged
*/
@ -2310,7 +2328,7 @@ bot_weapon_think()
if(weap == "")
continue;
self SwitchToWeapon(weap);
self thread changeToWeapon(weap);
}
}

View File

@ -65,6 +65,12 @@ init()
setDvar("bots_play_killstreak", true);
if(getDvar("bots_play_nade") == "")//bots grenade
setDvar("bots_play_nade", true);
if(getDvar("bots_play_knife") == "")//bots knife
setDvar("bots_play_knife", true);
if(getDvar("bots_play_fire") == "")//bots fire
setDvar("bots_play_fire", true);
if(getDvar("bots_play_move") == "")//bots move
setDvar("bots_play_move", true);
if(getDvar("bots_play_take_carepackages") == "")//bots take carepackages
setDvar("bots_play_take_carepackages", true);
if(getDvar("bots_play_obj") == "")//bots play the obj