Advertisement
VerTical_Dev

BO2, self Model Changer

Feb 28th, 2017
688
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.28 KB | None | 0 0
  1. init_modelchanger()
  2. {
  3.     self endon ( "disconnect" );
  4.     self endon ( "Quit_Changer" );
  5.    
  6.     self setClientThirdPerson ( true );
  7.     struct = spawnstruct();
  8.     struct.hud [ 0 ] = drawText ( "Press [{+attack}] or [{+speed_throw}] To Change Your Model, Cancel [{+melee}]", "default", 1.7, "CENTER", "CENTER", 0, 200, ( 1, 1, 1 ), 1, 2);
  9.     struct.hud [ 1 ] = createShader( "white", "CENTER", "CENTER", 0, 200, 1000, 20, ( 0, 0, 0 ), .5, 1);
  10.     struct.list = strtok ( "spread;default;mg;rifle;smg", ";" ); //Thx To Patrick ( Extinct )!
  11.     struct.index = int ( 0 );
  12.    
  13.     wait .3;
  14.     while ( isDefined ( struct ) )
  15.     {
  16.         if ( self AttackButtonPressed () )
  17.         {
  18.             struct.index++;
  19.            
  20.             if( struct.index > 4 )
  21.                 struct.index = int ( 0 );
  22.                
  23.             self [[ game[ "set_player_model" ][ self.team ][ struct.list [ struct.index ] ] ]]();
  24.             wait .1;
  25.         }
  26.        
  27.         if ( self AdsButtonPressed () )
  28.         {
  29.             struct.index--;
  30.            
  31.             if( struct.index < int ( 0 ) )
  32.                 struct.index = 4;
  33.                
  34.             self [[ game[ "set_player_model" ][ self.team ][ struct.list [ struct.index ] ] ]]();
  35.             wait .1;
  36.         }
  37.        
  38.         if ( self MeleeButtonPressed() ) break;
  39.        
  40.         wait .05;
  41.     }
  42.    
  43.     self setClientThirdPerson ( false );
  44.    
  45.     foreach ( hud in struct.hud )
  46.     hud destroy ();
  47.    
  48.     struct = undefined;
  49.     self notify ( "Quit_Changer" );
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement