mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-21 21:45:43 +00:00
mod
This commit is contained in:
parent
c146886a99
commit
a85e91c1af
@ -558,3 +558,7 @@ set scr_helicopter_allowQueue "0"
|
||||
set scr_helicopter_cobra_duration "30"
|
||||
set scr_helicopter_pavelow_duration "30"
|
||||
set scr_helicopter_apache_duration "30"
|
||||
|
||||
// _autosentry
|
||||
set scr_sentry_duration "90"
|
||||
set scr_sentry_killsIncreaseStreak "1"
|
||||
|
@ -1,3 +1,17 @@
|
||||
/*
|
||||
_autosentry modded
|
||||
Author: INeedGames
|
||||
Date: 09/26/2020
|
||||
Adds .lifeId to sentries so that players can get killstreaks
|
||||
|
||||
DVARS:
|
||||
- scr_sentry_duration <int>
|
||||
90 - (default) amount of seconds for an sentry to last
|
||||
|
||||
- scr_sentry_killsIncreaseStreak <bool>
|
||||
false - (default) if kills from a sentry gun increases the user's current streak on that life
|
||||
*/
|
||||
|
||||
#include maps\mp\_utility;
|
||||
#include maps\mp\gametypes\_hud_util;
|
||||
#include common_scripts\utility;
|
||||
@ -41,6 +55,12 @@ init()
|
||||
level._effect[ "sentry_overheat_mp" ] = loadfx( "smoke/sentry_turret_overheat_smoke" );
|
||||
level._effect[ "sentry_explode_mp" ] = loadfx( "explosions/sentry_gun_explosion" );
|
||||
level._effect[ "sentry_smoke_mp" ] = loadfx( "smoke/car_damage_blacksmoke" );
|
||||
|
||||
setDvarIfUninitialized( "scr_sentry_duration", 90 );
|
||||
setDvarIfUninitialized( "scr_sentry_killsIncreaseStreak", false );
|
||||
|
||||
level.sentryDuration = getDvarInt( "scr_sentry_duration" );
|
||||
level.sentryKillsIncreaseStreak = getDvarInt( "scr_sentry_killsIncreaseStreak" );
|
||||
}
|
||||
|
||||
/* ============================
|
||||
@ -49,7 +69,7 @@ init()
|
||||
|
||||
tryUseAutoSentry( lifeId )
|
||||
{
|
||||
result = self giveSentry( "sentry_minigun" );
|
||||
result = self giveSentry( "sentry_minigun", lifeId );
|
||||
if ( result )
|
||||
self maps\mp\_matchdata::logKillstreakEvent( "sentry", self.origin );
|
||||
|
||||
@ -59,7 +79,7 @@ tryUseAutoSentry( lifeId )
|
||||
|
||||
tryUseAutoGlSentry( lifeId )
|
||||
{
|
||||
result = self giveSentry( "sentry_gun" );
|
||||
result = self giveSentry( "sentry_gun", lifeId );
|
||||
if ( result )
|
||||
self maps\mp\_matchdata::logKillstreakEvent( "sentry_gl", self.origin );
|
||||
|
||||
@ -67,12 +87,15 @@ tryUseAutoGlSentry( lifeId )
|
||||
}
|
||||
|
||||
|
||||
giveSentry( sentryType )
|
||||
giveSentry( sentryType, lifeId )
|
||||
{
|
||||
self.last_sentry = sentryType;
|
||||
|
||||
sentryGun = createSentryForPlayer( sentryType, self );
|
||||
|
||||
if (level.sentryKillsIncreaseStreak)
|
||||
sentryGun.lifeId = lifeId;
|
||||
|
||||
self setCarryingSentry( sentryGun, true );
|
||||
|
||||
// if we failed to place the sentry, it will have been deleted at this point
|
||||
@ -555,7 +578,7 @@ sentry_timeOut()
|
||||
self endon( "death" );
|
||||
level endon ( "game_ended" );
|
||||
|
||||
lifeSpan = SENTRY_TIME_OUT;
|
||||
lifeSpan = level.sentryDuration;
|
||||
|
||||
while ( lifeSpan )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user