Advertisement
KhelMho

Sprint Reload

Aug 8th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.16 KB | None | 0 0
  1. //==========================================================//
  2. //  Go to your "_zombiemode.gsc" and add this in "main()"   //
  3. //==========================================================//
  4. level.sprint_reload_perk = "specialty_fastreload";
  5. //==========================================================//
  6.  
  7.  
  8.  
  9. //==========================================================//
  10. //  Next find this "onPlayerConnect()"                      //
  11. //  Underneath "player thread watchTakenDamage();"          //
  12. //  Add this:                                               //
  13. //==========================================================//
  14. player thread reload_watch();
  15. player thread reload_cancel_watch();
  16. player thread sprint_watch();
  17. //==========================================================//
  18.  
  19.  
  20.  
  21. //==========================================================//
  22. //  Now add this script at the bottom of "_zombiemode.gsc"  //
  23. //==========================================================//
  24. reload_watch()
  25. {
  26.     self endon( "disconnect" );
  27.     while(1)
  28.     {
  29.         self waittill( "reload_start" );
  30.         if( !self hasperk( level.sprint_reload_perk ) || !isdefined( self.is_sprinting ) )
  31.         {
  32.             continue;
  33.         }
  34.         self AllowSprint( false );
  35.         self setMoveSpeedScale( 1.5 );
  36.         self waittill_either( "reload", "reload_cancel" );
  37.         self AllowSprint( true );
  38.         if( self hasperk( "specialty_longersprint" ))
  39.         {
  40.             self setMoveSpeedScale( 1.07 );
  41.         }
  42.         else
  43.         {
  44.             self setMoveSpeedScale( 1 );
  45.         }
  46.     }
  47. }
  48.  
  49. reload_cancel_watch()
  50. {
  51.     self endon( "disconnect" );
  52.     while( 1 )
  53.     {
  54.         wait .1;
  55.         if( self hasperk( level.sprint_reload_perk ) && ( self isthrowinggrenade() || self isswitchingweapons() || self ismeleeing() ) )
  56.         {
  57.             self notify( "reload_cancel" );
  58.             wait 1;
  59.         }
  60.     }
  61. }
  62.  
  63. sprint_watch()
  64. {
  65.     self endon( "disconnect" );
  66.     while( 1 )
  67.     {
  68.         wait .05;
  69.         if( self get_player_speed() < 290 )
  70.         {
  71.             if( isdefined( self.is_sprinting ) )
  72.             {
  73.                 self.is_sprinting = undefined;
  74.             }
  75.             continue;
  76.         }
  77.         if( !self hasperk( level.sprint_reload_perk ) )
  78.         {
  79.             continue;
  80.         }
  81.         self.is_sprinting = true;
  82.         wait 1;
  83.     }
  84. }
  85.  
  86. get_player_speed()
  87. {
  88.     velocity = self GetVelocity();
  89.     speed = abs( velocity[0] ) + abs( velocity[1] );
  90.     return speed;
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement