mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-22 05:55:42 +00:00
bot custom loadout script
This commit is contained in:
parent
787c1476e0
commit
e3ca44a107
64
userraw/scripts/bots_sniper_loadout.gsc
Normal file
64
userraw/scripts/bots_sniper_loadout.gsc
Normal file
@ -0,0 +1,64 @@
|
||||
#include maps\mp\_utility;
|
||||
#include maps\mp\gametypes\_hud_util;
|
||||
#include common_scripts\utility;
|
||||
#include maps\mp\bots\_bot_utility;
|
||||
|
||||
init()
|
||||
{
|
||||
setDvarIfUninitialized( "bots_sniperLoadout", false );
|
||||
|
||||
level thread onBotConnected();
|
||||
}
|
||||
|
||||
onBotConnected()
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
level waittill("bot_connected", bot);
|
||||
|
||||
bot thread onBotGivenLoadout();
|
||||
}
|
||||
}
|
||||
|
||||
onBotGivenLoadout()
|
||||
{
|
||||
self endon("disconnect");
|
||||
|
||||
for (;;)
|
||||
{
|
||||
self waittill( "bot_giveLoadout", allowCopycat );
|
||||
|
||||
if (!getDvarInt("bots_sniperLoadout"))
|
||||
continue;
|
||||
|
||||
// clear perks and weapons
|
||||
self takeAllWeapons();
|
||||
self.specialty = [];
|
||||
self _clearPerks();
|
||||
self maps\mp\gametypes\_class::_detachAll();
|
||||
|
||||
// give perks
|
||||
self maps\mp\perks\_perks::givePerk( "specialty_fastreload" );
|
||||
self maps\mp\perks\_perks::givePerk( "specialty_quickdraw" );
|
||||
self maps\mp\perks\_perks::givePerk( "specialty_bulletdamage" );
|
||||
self maps\mp\perks\_perks::givePerk( "specialty_armorpiercing" );
|
||||
self maps\mp\perks\_perks::givePerk( "specialty_bulletaccuracy" );
|
||||
self maps\mp\perks\_perks::givePerk( "specialty_holdbreath" );
|
||||
|
||||
// give weapons
|
||||
self _giveWeapon( "usp_mp", 0 );
|
||||
self SetWeaponAmmoClip( "usp_mp", 0 );
|
||||
self SetWeaponAmmoStock( "usp_mp", 0 );
|
||||
|
||||
self _giveWeapon( "cheytac_mp", 0 );
|
||||
self setSpawnWeapon( "cheytac_mp" );
|
||||
|
||||
// make into sniper model
|
||||
if ( level.environment != "" )
|
||||
self [[game[team+"_model"]["GHILLIE"]]]();
|
||||
else
|
||||
self [[game[team+"_model"]["SNIPER"]]]();
|
||||
// reset the bot anim model
|
||||
self maps\mp\bots\_bot_internal::botsDeleteFakeAnim();
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user