UGX-Mods

Call of Duty 5: World at War => Tutorial Desk => Scripting => Topic started by: Tim Smith on December 26, 2016, 10:23:29 am

Title: Get 130 Points while knifing in Insta-Kill
Post by: Tim Smith on December 26, 2016, 10:23:29 am
I take no credit for this Tut. However, make sure to credit "alaurenc9". Just wanted to share it with people.


First go open _zombiemode_spawner.gsc & Find :
Code Snippet
Plaintext
self thread maps\_zombiemode_powerups::check_for_instakill( player );
Replace with :
Code Snippet
Plaintext
self thread maps\_zombiemode_powerups::check_for_instakill( player, mod, hit_location );


Save and close the file, now go open _zombiemode_powerups.gsc Find & Replace the hole check_for_instakill() function with this :
Code Snippet
Plaintext
check_for_instakill( player, mod )
{
   if( IsDefined( player ) && IsAlive( player ) && level.zombie_vars[ "zombie_insta_kill" ] )
   {
      if( is_magic_bullet_shield_enabled( self ) )
      {
         return;
      }
      if( self.animname == "boss_zombie" )
      {
         return;
      }
      if( player.use_weapon_type == "MOD_MELEE" )
      {
         player.last_kill_method = "MOD_MELEE";
      }
      else
      {
         player.last_kill_method = "MOD_UNKNOWN";
      }
      modName = remove_mod_from_methodofdeath( mod );
      if( flag( "dog_round" ) )
      {
         self DoDamage( self.health + 666, self.origin, player, undefined, modName );
         player notify( "zombie_killed" );
      }
      else
      {
         self maps\_zombiemode_spawner::zombie_head_gib();
         self DoDamage( self.health + 666, self.origin, player, undefined, modName );
         player notify( "zombie_killed" );
      }
   }
}


Save and close that file also. Now open _zombiemode_utility.gsc Paste this at the bottom of the file
Code Snippet
Plaintext
remove_mod_from_methodofdeath( mod )
{
   modStrings = StrTok( mod, "_" );
   modName = "";
   for( i = 1; i < modStrings.size; i ++ )
   {
      modName += modStrings[i];
   }
   return modName;
}


That's it enjoy.  :gusta:
Title: Re: Get 130 Points while knifing in Insta-Kill
Post by: EmpGeneral on December 26, 2016, 03:55:41 pm
Thanks for this! :D
Title: Re: Get 130 Points while knifing in Insta-Kill
Post by: frogkm on June 21, 2021, 02:14:27 am
This tut worked for knifing, but now for some reason the game freezes when I aim down sights and shoot a zombie during instakill.  After the long freeze of about 5 seconds, the shot disappears and doesn't kill the zombie.  This issue is only when I have instakill and when I aim down the sights and shoot at a zombie.  I've reversed the steps in this tut and my issue is fixed, but I'm wondering if you noticed the same issue?
Title: Re: Get 130 Points while knifing in Insta-Kill
Post by: Tetration on June 13, 2022, 12:36:19 am
This tut worked for knifing, but now for some reason the game freezes when I aim down sights and shoot a zombie during instakill.  After the long freeze of about 5 seconds, the shot disappears and doesn't kill the zombie.  This issue is only when I have instakill and when I aim down the sights and shoot at a zombie.  I've reversed the steps in this tut and my issue is fixed, but I'm wondering if you noticed the same issue?
I know it's a bit late, but I've solved this bug. Apparently giving an empty string to strTok creates an infinite loop, which causes the thread to be killed after getting stuck for a few seconds. To fix this, change the remove_mod_from_methodofdeath function to the following:
 
Code Snippet
cpp
remove_mod_from_methodofdeath( mod )
{
   if (mod == "")
      return "";
   modStrings = strTok( mod, "_" );
   modName = "";
   for( i = 1; i < modStrings.size; i ++ )
   {
      modName += modStrings[i];
   }
   return modName;
}