mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-22 05:55:42 +00:00
new dvar
This commit is contained in:
parent
395a991b6f
commit
a015aed62a
@ -6,8 +6,11 @@
|
|||||||
init()
|
init()
|
||||||
{
|
{
|
||||||
setDvarIfUninitialized( "bots_sniperLoadout", false );
|
setDvarIfUninitialized( "bots_sniperLoadout", false );
|
||||||
|
setDvarIfUninitialized( "bots_oneHardIsSniper", false );
|
||||||
|
|
||||||
level thread onBotConnected();
|
level thread onBotConnected();
|
||||||
|
|
||||||
|
level thread watchOneHardIsSniper();
|
||||||
}
|
}
|
||||||
|
|
||||||
onBotConnected()
|
onBotConnected()
|
||||||
@ -31,6 +34,34 @@ onBotGivenLoadout()
|
|||||||
if ( !getDvarInt( "bots_sniperLoadout" ) )
|
if ( !getDvarInt( "bots_sniperLoadout" ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
self give_sniper_loadout();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
watchOneHardIsSniper()
|
||||||
|
{
|
||||||
|
for(;;)
|
||||||
|
{
|
||||||
|
wait 1;
|
||||||
|
|
||||||
|
if ( !getDvarInt( "bots_oneHardIsSniper" ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
foreach (bot in level.bots)
|
||||||
|
{
|
||||||
|
if (bot.pers["bots"]["skill"]["base"] >= 7)
|
||||||
|
{
|
||||||
|
if (isAlive(bot) && !bot.isSniper)
|
||||||
|
bot give_sniper_loadout();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
give_sniper_loadout()
|
||||||
|
{
|
||||||
self.pers["bots"]["behavior"]["quickscope"] = true;
|
self.pers["bots"]["behavior"]["quickscope"] = true;
|
||||||
|
|
||||||
// clear perks and weapons
|
// clear perks and weapons
|
||||||
@ -60,5 +91,6 @@ onBotGivenLoadout()
|
|||||||
self [[game[self.team + "_model"]["GHILLIE"]]]();
|
self [[game[self.team + "_model"]["GHILLIE"]]]();
|
||||||
else
|
else
|
||||||
self [[game[self.team + "_model"]["SNIPER"]]]();
|
self [[game[self.team + "_model"]["SNIPER"]]]();
|
||||||
}
|
|
||||||
|
self.isSniper = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user