mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-23 06:15:43 +00:00
nukes
This commit is contained in:
parent
ea39456fd9
commit
1706cef05e
@ -24,64 +24,68 @@ init()
|
|||||||
|
|
||||||
watchSniper()
|
watchSniper()
|
||||||
{
|
{
|
||||||
if (getDvar("bot_sniperCheck") == "")
|
if ( getDvar( "bot_sniperCheck" ) == "" )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (;;)
|
for ( ;; )
|
||||||
{
|
{
|
||||||
wait 15;
|
wait 15;
|
||||||
|
|
||||||
numPlayers = 0;
|
numPlayers = 0;
|
||||||
numSnipers = 0;
|
numSnipers = 0;
|
||||||
|
|
||||||
for(i = 0; i < level.players.size; i++)
|
for ( i = 0; i < level.players.size; i++ )
|
||||||
{
|
{
|
||||||
player = level.players[i];
|
player = level.players[i];
|
||||||
if (player is_bot())
|
|
||||||
|
if ( player is_bot() )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!isDefined(player.team))
|
if ( !isDefined( player.team ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
numPlayers++;
|
numPlayers++;
|
||||||
|
|
||||||
if (isDefined(player.isSniper) && player.isSniper)
|
if ( isDefined( player.isSniper ) && player.isSniper )
|
||||||
numSnipers++;
|
numSnipers++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (numPlayers > 0)
|
if ( numPlayers > 0 )
|
||||||
{
|
{
|
||||||
if (numSnipers / numPlayers >= 0.5)
|
if ( numSnipers / numPlayers >= 0.5 )
|
||||||
setDvar("bots_sniperLoadout", 1);
|
setDvar( "bots_sniperLoadout", 1 );
|
||||||
else
|
else
|
||||||
setDvar("bots_sniperLoadout", 0);
|
setDvar( "bots_sniperLoadout", 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
watchNuke()
|
watchNuke()
|
||||||
{
|
{
|
||||||
setDvar("scr_spawnpointfavorweight", "");
|
setDvar( "scr_spawnpointfavorweight", "" );
|
||||||
level waittill( "nuke_death" );
|
|
||||||
setDvar("scr_spawnpointfavorweight", "499999");
|
for ( i = 0; i < 3; i++ )
|
||||||
|
level waittill( "nuke_death" );
|
||||||
|
|
||||||
|
setDvar( "scr_spawnpointfavorweight", "499999" );
|
||||||
}
|
}
|
||||||
|
|
||||||
watchBoxmap()
|
watchBoxmap()
|
||||||
{
|
{
|
||||||
if (getDvar("mapname") == "iw4_credits")
|
if ( getDvar( "mapname" ) == "iw4_credits" )
|
||||||
setDvar("scr_spawnsimple", 1);
|
setDvar( "scr_spawnsimple", 1 );
|
||||||
else
|
else
|
||||||
setDvar("scr_spawnsimple", 0);
|
setDvar( "scr_spawnsimple", 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
watchBotCrackedClass()
|
watchBotCrackedClass()
|
||||||
{
|
{
|
||||||
if(getDvar("bot_pvb_helper_customBotClassTeam") == "")
|
if ( getDvar( "bot_pvb_helper_customBotClassTeam" ) == "" )
|
||||||
setDvar("bot_pvb_helper_customBotClassTeam", "");
|
setDvar( "bot_pvb_helper_customBotClassTeam", "" );
|
||||||
|
|
||||||
for (;;)
|
for ( ;; )
|
||||||
{
|
{
|
||||||
level waittill("bot_connected", bot);
|
level waittill( "bot_connected", bot );
|
||||||
|
|
||||||
bot thread watchBotLoadout();
|
bot thread watchBotLoadout();
|
||||||
}
|
}
|
||||||
@ -89,20 +93,20 @@ watchBotCrackedClass()
|
|||||||
|
|
||||||
watchBotLoadout()
|
watchBotLoadout()
|
||||||
{
|
{
|
||||||
self endon("disconnect");
|
self endon( "disconnect" );
|
||||||
|
|
||||||
random = randomInt(2);
|
random = randomInt( 2 );
|
||||||
|
|
||||||
for (;;)
|
for ( ;; )
|
||||||
{
|
{
|
||||||
self waittill("bot_giveLoadout");
|
self waittill( "bot_giveLoadout" );
|
||||||
|
|
||||||
team = getDvar("bot_pvb_helper_customBotClassTeam");
|
team = getDvar( "bot_pvb_helper_customBotClassTeam" );
|
||||||
|
|
||||||
if (team == "")
|
if ( team == "" )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (self.team != team)
|
if ( self.team != team )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// clear perks and weapons
|
// clear perks and weapons
|
||||||
@ -121,7 +125,8 @@ watchBotLoadout()
|
|||||||
self maps\mp\perks\_perks::givePerk( "semtex_mp" );
|
self maps\mp\perks\_perks::givePerk( "semtex_mp" );
|
||||||
|
|
||||||
twoStreak = "helicopter_minigun";
|
twoStreak = "helicopter_minigun";
|
||||||
if (random)
|
|
||||||
|
if ( random )
|
||||||
twoStreak = "ac130";
|
twoStreak = "ac130";
|
||||||
|
|
||||||
self maps\mp\gametypes\_class::setKillstreaks( "harrier_airstrike", twoStreak, "nuke" );
|
self maps\mp\gametypes\_class::setKillstreaks( "harrier_airstrike", twoStreak, "nuke" );
|
||||||
@ -137,27 +142,29 @@ watchBotLoadout()
|
|||||||
|
|
||||||
watchTeams()
|
watchTeams()
|
||||||
{
|
{
|
||||||
if(getDvar("bot_pvb_helper_noPlayersOnTeam") == "")
|
if ( getDvar( "bot_pvb_helper_noPlayersOnTeam" ) == "" )
|
||||||
setDvar("bot_pvb_helper_noPlayersOnTeam", "");
|
setDvar( "bot_pvb_helper_noPlayersOnTeam", "" );
|
||||||
|
|
||||||
for (;;)
|
for ( ;; )
|
||||||
{
|
{
|
||||||
wait 1;
|
wait 1;
|
||||||
|
|
||||||
if (getDvar("bot_pvb_helper_noPlayersOnTeam") == "")
|
if ( getDvar( "bot_pvb_helper_noPlayersOnTeam" ) == "" )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
team = getDvar("bot_pvb_helper_noPlayersOnTeam");
|
team = getDvar( "bot_pvb_helper_noPlayersOnTeam" );
|
||||||
for(i = 0; i < level.players.size; i++)
|
|
||||||
|
for ( i = 0; i < level.players.size; i++ )
|
||||||
{
|
{
|
||||||
player = level.players[i];
|
player = level.players[i];
|
||||||
if (player is_bot())
|
|
||||||
|
if ( player is_bot() )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (player.team != team)
|
if ( player.team != team )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (team == "axis")
|
if ( team == "axis" )
|
||||||
player [[level.allies]]();
|
player [[level.allies]]();
|
||||||
else
|
else
|
||||||
player [[level.axis]]();
|
player [[level.axis]]();
|
||||||
@ -167,40 +174,42 @@ watchTeams()
|
|||||||
|
|
||||||
onBotSayVar()
|
onBotSayVar()
|
||||||
{
|
{
|
||||||
SetDvar("bot_say", "");
|
SetDvar( "bot_say", "" );
|
||||||
for (;;)
|
|
||||||
|
for ( ;; )
|
||||||
{
|
{
|
||||||
wait 0.05;
|
wait 0.05;
|
||||||
|
|
||||||
toSay = GetDvar("bot_say");
|
toSay = GetDvar( "bot_say" );
|
||||||
if (toSay == "")
|
|
||||||
|
if ( toSay == "" )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
bot = random(getBotArray());
|
bot = random( getBotArray() );
|
||||||
|
|
||||||
if (!isDefined(bot))
|
if ( !isDefined( bot ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
SetDvar("bot_say", "");
|
SetDvar( "bot_say", "" );
|
||||||
bot sayall(toSay);
|
bot sayall( toSay );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onSomeoneSaid()
|
onSomeoneSaid()
|
||||||
{
|
{
|
||||||
for (;;)
|
for ( ;; )
|
||||||
{
|
{
|
||||||
level waittill("say", string, player);
|
level waittill( "say", string, player );
|
||||||
|
|
||||||
PrintConsole(player.name + ": ^7" + string + "\n");
|
PrintConsole( player.name + ": ^7" + string + "\n" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onBotConnected()
|
onBotConnected()
|
||||||
{
|
{
|
||||||
for (;;)
|
for ( ;; )
|
||||||
{
|
{
|
||||||
level waittill("bot_connected", bot);
|
level waittill( "bot_connected", bot );
|
||||||
|
|
||||||
bot thread setBotPing();
|
bot thread setBotPing();
|
||||||
}
|
}
|
||||||
@ -208,12 +217,12 @@ onBotConnected()
|
|||||||
|
|
||||||
setBotPing()
|
setBotPing()
|
||||||
{
|
{
|
||||||
self endon("disconnect");
|
self endon( "disconnect" );
|
||||||
|
|
||||||
for (;;)
|
for ( ;; )
|
||||||
{
|
{
|
||||||
wait 0.05;
|
wait 0.05;
|
||||||
|
|
||||||
self SetPing(randomIntRange(40, 60));
|
self SetPing( randomIntRange( 40, 60 ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user