Can switch to altmode with spawnweapon hack

This commit is contained in:
INeedBots 2021-03-26 19:11:42 -06:00
parent 00dfc54988
commit 01eebf6a8c
2 changed files with 22 additions and 1 deletions

View File

@ -688,6 +688,9 @@ changeToWeapon(weap)
self SwitchToWeapon(weap); self SwitchToWeapon(weap);
if (isWeaponAltmode(weap))
self setSpawnWeapon(weap);
self waittill_any_timeout(5, "weapon_change"); self waittill_any_timeout(5, "weapon_change");
return (self GetCurrentWeapon() == weap); return (self GetCurrentWeapon() == weap);
@ -2530,7 +2533,6 @@ follow_target()
/* /*
Fast swaps or reload cancels don't work cause t5 bots wait for the anim to complete Fast swaps or reload cancels don't work cause t5 bots wait for the anim to complete
t5 bots cannot switch to altmode
Bots will think to switch weapons Bots will think to switch weapons
*/ */
bot_weapon_think() bot_weapon_think()

View File

@ -145,6 +145,25 @@ GetBotDiffNum()
return num; return num;
} }
/*
is the weapon alt mode?
*/
isWeaponAltmode(weap)
{
if (isStrStart(weap, "gl_") || isStrStart(weap, "ft_") || isStrStart(weap, "mk_"))
return true;
return false;
}
/*
If the string starts with
*/
isStrStart( string1, subStr )
{
return ( getSubStr( string1, 0, subStr.size ) == subStr );
}
/* /*
Taken from iw4 script Taken from iw4 script
*/ */