Advertisement
KhelMho

Untitled

Aug 8th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.25 KB | None | 0 0
  1. reload_watch()
  2. {
  3.     self endon( "disconnect" );
  4.     while(1)
  5.     {
  6.         self waittill( "reload_start" );
  7.         if( !self hasperk( level.sprint_reload_perk ) || !isdefined( self.is_sprinting ) )
  8.         {
  9.             continue;
  10.         }
  11.         self AllowSprint( false );
  12.         self setMoveSpeedScale( 1.5 );
  13.         self waittill_either( "reload", "reload_cancel" );
  14.         self AllowSprint( true );
  15.         if( self hasperk( "specialty_longersprint" ))
  16.         {
  17.             self setMoveSpeedScale( 1.07 );
  18.         }
  19.         else
  20.         {
  21.             self setMoveSpeedScale( 1 );
  22.         }
  23.     }
  24. }
  25.  
  26. reload_cancel_watch()
  27. {
  28.     self endon( "disconnect" );
  29.     while( 1 )
  30.     {
  31.         wait .1;
  32.         if( self hasperk( level.sprint_reload_perk ) && ( self isthrowinggrenade() || self isswitchingweapons() || self ismeleeing() ) )
  33.         {
  34.             self notify( "reload_cancel" );
  35.             wait 1;
  36.         }
  37.     }
  38. }
  39.  
  40. sprint_watch()
  41. {
  42.     self endon( "disconnect" );
  43.     while( 1 )
  44.     {
  45.         wait .05;
  46.         if( self get_player_speed() < 290 )
  47.         {
  48.             if( isdefined( self.is_sprinting ) )
  49.             {
  50.                 self.is_sprinting = undefined;
  51.             }
  52.             continue;
  53.         }
  54.         if( !self hasperk( level.sprint_reload_perk ) )
  55.         {
  56.             continue;
  57.         }
  58.         self.is_sprinting = true;
  59.         wait 1;
  60.     }
  61. }
  62.  
  63. get_player_speed()
  64. {
  65.     velocity = self GetVelocity();
  66.     speed = abs( velocity[0] ) + abs( velocity[1] );
  67.     return speed;
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement