
Posts
369
Respect
94Add +1
Forum Rank
Perk Hacker
Primary Group
Scripter
Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!![]() | Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community. |
PlayerLastStand( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration )
{
if( sMeansOfDeath == "MOD_CRUSH" ) // if getting run over by a tank then kill the guy even if in laststand
{
if( self player_is_in_laststand() )
{
self mission_failed_during_laststand( self );
}
return;
}
if( self player_is_in_laststand() )
{
return;
}
//CODER_MOD: TOMMYK 06/26/2008 - For coop scoreboards
self.downs++;
//stat tracking
self.stats["downs"] = self.downs;
dvarName = "player" + self GetEntityNumber() + "downs";
setdvar( dvarName, self.downs );
//PI CHANGE: player shouldn't be able to jump while in last stand mode (only was a problem in water) - specifically disallow this
if (IsDefined(level.script) && level.script == "nazi_zombie_sumpf")
self AllowJump(false);
//END PI CHANGE
if( IsDefined( level.playerlaststand_func ) )
{
[[level.playerlaststand_func]]();
}
//CODER_MOD: Jay (6/18/2008): callback to challenge system
maps\_challenges_coop::doMissionCallback( "playerDied", self );
if ( !laststand_allowed( sWeapon, sMeansOfDeath, sHitLoc ) )
{
self mission_failed_during_laststand( self );
return;
}
// check for all players being in last stand
if ( player_all_players_in_laststand() )
{
self mission_failed_during_laststand( self );
return;
}
// vision set
self VisionSetLastStand( "laststand", 1 );
self.health = 1;
self thread maps\_arcademode::arcadeMode_player_laststand();
// revive trigger
self revive_trigger_spawn();
// laststand weapons
self laststand_take_player_weapons();
self laststand_give_pistol();
self thread laststand_give_grenade();
// AI
self.ignoreme = true;
// bleed out timer
self thread laststand_bleedout( GetDvarFloat( "player_lastStandBleedoutTime" ) );
self notify( "player_downed" );
}
PlayerLastStand( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration )
{
primaryWeapons = self GetWeaponsListPrimaries();
if(primaryWeapons.size == 3) // he has three weapons
{
current_weapon = self getCurrentWeapon(); // get his current weapon
player_load = self GetWeaponsListPrimaries();
if (current_weapon == primaryWeapons[2])
{
self.take_weapon = player_load[1];
self takeweapon(self.take_weapon);
}
else
{
self.take_weapon = player_load[2];
self takeweapon(self.take_weapon);
}
}
if( sMeansOfDeath == "MOD_CRUSH" ) // if getting run over by a tank then kill the guy even if in laststand
{
if( self player_is_in_laststand() )
{
self mission_failed_during_laststand( self );
}
return;
}
if( self player_is_in_laststand() )
{
return;
}
//CODER_MOD: TOMMYK 06/26/2008 - For coop scoreboards
self.downs++;
//stat tracking
self.stats["downs"] = self.downs;
dvarName = "player" + self GetEntityNumber() + "downs";
setdvar( dvarName, self.downs );
//PI CHANGE: player shouldn't be able to jump while in last stand mode (only was a problem in water) - specifically disallow this
if (IsDefined(level.script) && level.script == "nazi_zombie_sumpf")
self AllowJump(false);
//END PI CHANGE
if( IsDefined( level.playerlaststand_func ) )
{
[[level.playerlaststand_func]]();
}
//CODER_MOD: Jay (6/18/2008): callback to challenge system
maps\_challenges_coop::doMissionCallback( "playerDied", self );
if ( !laststand_allowed( sWeapon, sMeansOfDeath, sHitLoc ) )
{
self mission_failed_during_laststand( self );
return;
}
// check for all players being in last stand
if ( player_all_players_in_laststand() )
{
self mission_failed_during_laststand( self );
return;
}
// vision set
self VisionSetLastStand( "laststand", 1 );
self.health = 1;
self thread maps\_arcademode::arcadeMode_player_laststand();
// revive trigger
self revive_trigger_spawn();
// laststand weapons
self laststand_take_player_weapons();
self laststand_give_pistol();
self thread laststand_give_grenade();
// AI
self.ignoreme = true;
// bleed out timer
self thread laststand_bleedout( GetDvarFloat( "player_lastStandBleedoutTime" ) );
self notify( "player_downed" );
}
bo_perks_thread()
{
players = getplayers();
for(i=0;i<players.size;i++)
{
players[i] thread staminup();
players[i] thread deadshot();
players[i] thread mulekick();
}
}
staminup()
{
while(1)
{
if(self hasperk("specialty_longersprint"))
self setmovespeedscale(1.15);
else
self setmovespeedscale(1);
wait .5;
}
}
deadshot()
{
while(1)
{
if(self hasperk("specialty_bulletaccuracy"))
self setClientDvar( "cg_laserForceOn", 1 );
else
self setClientDvar( "cg_laserForceOn", 0 );
wait .1;
}
}
mulekick()
{
while(1)
{
if(self hasperk("specialty_extraammo"))
self.inventorySize = 3;
else
self.inventorySize = 2;
wait .1;
}
}
treasure_chest_give_weapon( weapon_string )
{
primaryWeapons = self GetWeaponsListPrimaries();
current_weapon = undefined;
if( self HasWeapon( weapon_string ) )
{
self GiveMaxAmmo( weapon_string );
self SwitchToWeapon( weapon_string );
return;
}
// This should never be true for the first time.
if( primaryWeapons.size >= 2 ) // he has two weapons
{
current_weapon = self getCurrentWeapon(); // get hiss current weapon
if ( current_weapon == "mine_bouncing_betty" )
{
current_weapon = undefined;
}
if( isdefined( current_weapon ) )
{
if( !( weapon_string == "fraggrenade" || weapon_string == "stielhandgranate" || weapon_string == "molotov" || weapon_string == "zombie_cymbal_monkey" ) )
{
// PI_CHANGE_BEGIN
// JMA - player dropped the tesla gun
if( isDefined(level.script) && (level.script == "nazi_zombie_sumpf" || level.script == "nazi_zombie_factory") )
{
if( current_weapon == "tesla_gun" )
{
level.player_drops_tesla_gun = true;
}
}
// PI_CHANGE_END
self TakeWeapon( current_weapon );
}
}
}
if( IsDefined( primaryWeapons ) && !isDefined( current_weapon ) )
{
for( i = 0; i < primaryWeapons.size; i++ )
{
if( primaryWeapons[i] == "zombie_colt" )
{
continue;
}
if( weapon_string != "fraggrenade" && weapon_string != "stielhandgranate" && weapon_string != "molotov" && weapon_string != "zombie_cymbal_monkey" )
{
// PI_CHANGE_BEGIN
// JMA - player dropped the tesla gun
if( isDefined(level.script) && (level.script == "nazi_zombie_sumpf" || level.script == "nazi_zombie_factory") )
{
if( primaryWeapons[i] == "tesla_gun" )
{
level.player_drops_tesla_gun = true;
}
}
// PI_CHANGE_END
self TakeWeapon( primaryWeapons[i] );
}
}
}
self play_sound_on_ent( "purchase" );
if( weapon_string == "molotov" || weapon_string == "molotov_zombie" )
{
// PI_CHANGE_BEGIN
// JMA 051409 sanity check to see if we have the weapon before we remove it
has_weapon = self HasWeapon( "zombie_cymbal_monkey" );
if( isDefined(has_weapon) && has_weapon )
{
self TakeWeapon( "zombie_cymbal_monkey" );
}
// PI_CHANGE_END
}
if( weapon_string == "zombie_cymbal_monkey" )
{
// PI_CHANGE_BEGIN
// JMA 051409 sanity check to see if we have the weapon before we remove it
has_weapon = self HasWeapon( "molotov" );
if( isDefined(has_weapon) && has_weapon )
{
self TakeWeapon( "molotov" );
}
if( isDefined(level.zombie_weapons) && isDefined(level.zombie_weapons["molotov_zombie"]) )
{
has_weapon = self HasWeapon( "molotov_zombie" );
if( isDefined(has_weapon) && has_weapon )
{
self TakeWeapon( "molotov_zombie" );
}
}
// PI_CHANGE_END
self maps\_zombiemode_cymbal_monkey::player_give_cymbal_monkey();
play_weapon_vo(weapon_string);
return;
}
self GiveWeapon( weapon_string, 0 );
self GiveMaxAmmo( weapon_string );
self SwitchToWeapon( weapon_string );
play_weapon_vo(weapon_string);
// self playsound (level.zombie_weapons[weapon_string].sound);
}
treasure_chest_give_weapon( weapon_string )
{
primaryWeapons = self GetWeaponsListPrimaries();
current_weapon = undefined;
if( self HasWeapon( weapon_string ) )
{
self GiveMaxAmmo( weapon_string );
self SwitchToWeapon( weapon_string );
return;
}
// This should never be true for the first time.
if( (self.inventorySize == 2) && (primaryWeapons.size == 2) ) // he has two weapons
{
current_weapon = self getCurrentWeapon(); // get his current weapon
if ( current_weapon == "mine_bouncing_betty" )
{
current_weapon = undefined;
}
if( isdefined( current_weapon ) )
{
if( !( weapon_string == "fraggrenade" || weapon_string == "stielhandgranate" || weapon_string == "molotov" || weapon_string == "zombie_cymbal_monkey" ) )
{
// PI_CHANGE_BEGIN
// JMA - player dropped the tesla gun
if( isDefined(level.script) && (level.script == "nazi_zombie_sumpf" || level.script == "nazi_zombie_factory") )
{
if( current_weapon == "tesla_gun" )
{
level.player_drops_tesla_gun = true;
}
}
// PI_CHANGE_END
self TakeWeapon( current_weapon );
}
}
}
if( (self.inventorySize == 3) && (primaryWeapons.size == 3) ) // he has three weapons
{
current_weapon = self getCurrentWeapon(); // get his current weapon
if ( current_weapon == "mine_bouncing_betty" )
{
current_weapon = undefined;
}
if( isdefined( current_weapon ) )
{
if( !( weapon_string == "fraggrenade" || weapon_string == "stielhandgranate" || weapon_string == "molotov" || weapon_string == "zombie_cymbal_monkey" ) )
{
// PI_CHANGE_BEGIN
// JMA - player dropped the tesla gun
if( isDefined(level.script) && (level.script == "nazi_zombie_sumpf" || level.script == "nazi_zombie_factory") )
{
if( current_weapon == "tesla_gun" )
{
level.player_drops_tesla_gun = true;
}
}
// PI_CHANGE_END
self TakeWeapon( current_weapon );
}
}
}
self play_sound_on_ent( "purchase" );
if( weapon_string == "molotov" || weapon_string == "molotov_zombie" )
{
// PI_CHANGE_BEGIN
// JMA 051409 sanity check to see if we have the weapon before we remove it
has_weapon = self HasWeapon( "zombie_cymbal_monkey" );
if( isDefined(has_weapon) && has_weapon )
{
self TakeWeapon( "zombie_cymbal_monkey" );
}
// PI_CHANGE_END
}
if( weapon_string == "zombie_cymbal_monkey" )
{
// PI_CHANGE_BEGIN
// JMA 051409 sanity check to see if we have the weapon before we remove it
has_weapon = self HasWeapon( "molotov" );
if( isDefined(has_weapon) && has_weapon )
{
self TakeWeapon( "molotov" );
}
if( isDefined(level.zombie_weapons) && isDefined(level.zombie_weapons["molotov_zombie"]) )
{
has_weapon = self HasWeapon( "molotov_zombie" );
if( isDefined(has_weapon) && has_weapon )
{
self TakeWeapon( "molotov_zombie" );
}
}
// PI_CHANGE_END
self maps\_zombiemode_cymbal_monkey::player_give_cymbal_monkey();
play_weapon_vo(weapon_string);
return;
}
self GiveWeapon( weapon_string, 0 );
self GiveMaxAmmo( weapon_string );
self SwitchToWeapon( weapon_string );
play_weapon_vo(weapon_string);
// self playsound (level.zombie_weapons[weapon_string].sound);
}
weapon_give( weapon, is_upgrade )
{
primaryWeapons = self GetWeaponsListPrimaries();
current_weapon = undefined;
//if is not an upgraded perk purchase
if( !IsDefined( is_upgrade ) )
{
is_upgrade = false;
}
// This should never be true for the first time.
if( primaryWeapons.size >= 2 ) // he has two weapons
{
current_weapon = self getCurrentWeapon(); // get his current weapon
if ( current_weapon == "mine_bouncing_betty" )
{
current_weapon = undefined;
}
if( isdefined( current_weapon ) )
{
if( !( weapon == "fraggrenade" || weapon == "stielhandgranate" || weapon == "molotov" || weapon == "zombie_cymbal_monkey" ) )
{
self TakeWeapon( current_weapon );
}
}
}
if( weapon == "zombie_cymbal_monkey" )
{
// PI_CHANGE_BEGIN
// JMA 051409 sanity check to see if we have the weapon before we remove it
has_weapon = self HasWeapon( "molotov" );
if( isDefined(has_weapon) && has_weapon )
{
self TakeWeapon( "molotov" );
}
if( isDefined(level.zombie_weapons) && isDefined(level.zombie_weapons["molotov_zombie"]) )
{
has_weapon = self HasWeapon( "molotov_zombie" );
if( isDefined(has_weapon) && has_weapon )
{
self TakeWeapon( "molotov_zombie" );
}
}
// PI_CHANGE_END
self maps\_zombiemode_cymbal_monkey::player_give_cymbal_monkey();
play_weapon_vo( weapon );
return;
}
if( (weapon == "molotov" || weapon == "molotov_zombie") )
{
self TakeWeapon( "zombie_cymbal_monkey" );
}
self play_sound_on_ent( "purchase" );
self GiveWeapon( weapon, 0 );
self GiveMaxAmmo( weapon );
self SwitchToWeapon( weapon );
play_weapon_vo(weapon);
}
weapon_give( weapon, is_upgrade )
{
primaryWeapons = self GetWeaponsListPrimaries();
current_weapon = undefined;
//if is not an upgraded perk purchase
if( !IsDefined( is_upgrade ) )
{
is_upgrade = false;
}
// This should never be true for the first time.
if( (self.inventorySize == 2) && (primaryWeapons.size == 2) ) // he has two weapons
{
current_weapon = self getCurrentWeapon(); // get his current weapon
if ( current_weapon == "mine_bouncing_betty" )
{
current_weapon = undefined;
}
if( isdefined( current_weapon ) )
{
if( !( weapon == "fraggrenade" || weapon == "stielhandgranate" || weapon == "molotov" || weapon == "zombie_cymbal_monkey" ) )
{
self TakeWeapon( current_weapon );
}
}
}
if( (self.inventorySize == 3) && (primaryWeapons.size == 3) ) // he has three weapons
{
current_weapon = self getCurrentWeapon(); // get his current weapon
if ( current_weapon == "mine_bouncing_betty" )
{
current_weapon = undefined;
}
if( isdefined( current_weapon ) )
{
if( !( weapon == "fraggrenade" || weapon == "stielhandgranate" || weapon == "molotov" || weapon == "zombie_cymbal_monkey" ) )
{
self TakeWeapon( current_weapon );
}
}
}
if( weapon == "zombie_cymbal_monkey" )
{
// PI_CHANGE_BEGIN
// JMA 051409 sanity check to see if we have the weapon before we remove it
has_weapon = self HasWeapon( "molotov" );
if( isDefined(has_weapon) && has_weapon )
{
self TakeWeapon( "molotov" );
}
if( isDefined(level.zombie_weapons) && isDefined(level.zombie_weapons["molotov_zombie"]) )
{
has_weapon = self HasWeapon( "molotov_zombie" );
if( isDefined(has_weapon) && has_weapon )
{
self TakeWeapon( "molotov_zombie" );
}
}
// PI_CHANGE_END
self maps\_zombiemode_cymbal_monkey::player_give_cymbal_monkey();
play_weapon_vo( weapon );
return;
}
if( (weapon == "molotov" || weapon == "molotov_zombie") )
{
self TakeWeapon( "zombie_cymbal_monkey" );
}
self play_sound_on_ent( "purchase" );
self GiveWeapon( weapon, 0 );
self GiveMaxAmmo( weapon );
self SwitchToWeapon( weapon );
play_weapon_vo(weapon);
}
maps\_zombiemode_perks_black_ops::bo_perks_thread();
maps\_zombiemode::main();
maps\_zombiemode::main();
maps\_zombiemode_perks_black_ops::bo_perks_thread();
![]() | Has released one or more maps to the UGX-Mods community. |