Advertisement
momo5502

B3 Stuff by momo5502 and Uncle {SAM}

Mar 27th, 2013
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 15.12 KB | None | 0 0
  1. #include common_scripts\utility;
  2. #include maps\mp\_utility;
  3. #include maps\mp\gametypes\_hud_util;
  4.  
  5. /*
  6.     Title:      Modern Warfare 2 Big Brother Bot; New commands need this
  7.     Notes:      Simplified all the loops (reduced to only one montioring function).
  8.             Thx to [115]death for the Text structure code
  9.     Version:    1.1
  10.     Author:     Uncle {SAM}, momo5502, [115]death
  11. */
  12.  
  13.  
  14. init()
  15. {
  16.  
  17. level thread onPlayerConnect();
  18.  
  19. }
  20.  
  21.  
  22. onPlayerConnect()
  23. {
  24.            
  25.     for(;;)
  26.     {
  27.         level waittill( "connected", player );
  28.        
  29.         player thread onPlayerSpawned();
  30.  
  31.        
  32.     }
  33. }
  34.  
  35.  
  36. onPlayerSpawned()
  37. {
  38.     self endon( "disconnect" );
  39.    
  40.     for(;;)
  41.     {  
  42.         self waittill( "spawned_player" );
  43.        
  44.         self thread monitorStuff();
  45.     }
  46. }
  47.  
  48.  
  49. monitorStuff()
  50. {
  51.     self endon ( "disconnect" );
  52.     self endon ( "death" );
  53.    
  54.     SetDvarIfUninitialized( "b3_message", "");
  55.     SetDvarIfUninitialized( "b3_message1", "");
  56.     SetDvarIfUninitialized( "b3_message2", "");
  57.     SetDvarIfUninitialized( "teamswitch", -1);
  58.     SetDvarIfUninitialized( "explode", -1);
  59.    
  60.     for(;;)
  61.     {
  62.         if(getDvar("b3_message") != "")
  63.             self thread B3Message();        //The text people see's when a vote is called - This is Line 1
  64.            
  65.         if(getDvar("b3_message1") != "")
  66.             self thread B3Message1();       //^^^ - Line 2
  67.            
  68.         if(getDvar("b3_message2") != "")
  69.             self thread B3Message2();       //^^^ - Line 3
  70.            
  71.         if(getdvarint("teamswitch") != -1)
  72.             self thread TeamSwitch();
  73.            
  74.         if(getdvarint("explode") != -1)
  75.             self thread Explode();
  76.            
  77.         wait ( 0.2 );
  78.     }
  79. }
  80.  
  81.  
  82.  
  83.  
  84.  
  85. B3Message()
  86. {
  87.     self endon ( "disconnect" );
  88.     self endon ( "death" );
  89.  
  90.     self thread TextPopup4(getdvar("b3_message"));
  91. }
  92.  
  93. B3Message1()
  94. {
  95.     self endon ( "disconnect" );
  96.     self endon ( "death" );
  97.  
  98.     self thread TextPopup3(getdvar("b3_message1"));    
  99. }
  100.        
  101. B3Message2()
  102. {
  103.     self endon ( "disconnect" );
  104.     self endon ( "death" );
  105.  
  106.     self thread TextPopup5(getdvar("b3_message2"));
  107. }
  108.        
  109. TeamSwitch()
  110. {
  111.     self endon ( "disconnect" );
  112.     self endon ( "death" );
  113.  
  114.     if(self getEntityNumber() == getdvarint("teamswitch"))
  115.     {
  116.         if(self.pers["team"] == "allies")
  117.         {
  118.             self notify("menuresponse", game["menu_team"], "axis");
  119.             setDvar("teamswitch", -1);
  120.         }
  121.        
  122.         else if(self.pers["team"] == "axis")
  123.         {
  124.             self notify("menuresponse", game["menu_team"], "allies");
  125.             setDvar("teamswitch", -1);
  126.         }
  127.     }
  128. }
  129.  
  130. Explode()
  131. {
  132.     self endon ( "disconnect" );
  133.     self endon ( "death" );
  134.  
  135.     if(self getEntityNumber() == getdvarint("explode"))
  136.     {
  137.         setDvar("explode", -1);
  138.         if (self.pers["team"] != "spectator")
  139.         {
  140.             if(isAlive(self))
  141.             {
  142.                 self VisionSetNakedForPlayer( "mpnuke", .5 );
  143.                
  144.                 playFxOnTag( level.spawnGlow["enemy"], self, "j_head" );
  145.                 playFxOnTag( level.spawnGlow["enemy"], self, "tag_weapon_right" );
  146.                 playFxOnTag( level.spawnGlow["enemy"], self, "back_mid" );
  147.                 playFxOnTag( level.spawnGlow["enemy"], self, "torso_stabilizer" );
  148.                 playFxOnTag( level.spawnGlow["enemy"], self, "pelvis" );
  149.                
  150.                 sLocation = self getOrigin();
  151.                 sLocation += ( 0, 70, 100 ); //the higher the number the faster you go up
  152.                
  153.                 self SetOrigin( sLocation );
  154.                 self thread doKaBoom();
  155.             }
  156.         }
  157.     }
  158. }
  159.    
  160. doKaBoom()
  161. {
  162.     self setStance("stand");
  163.     self freezeControls(true);
  164.    
  165.     wait .2;
  166.    
  167.     level.chopper_fx["explode"]["medium"] = loadfx ("explosions/aerial_explosion");
  168.     level.chopper_fx["explode"]["medium"] = loadfx ("explosions/aerial_explosion");
  169.     level.chopper_fx["explode"]["medium"] = loadfx ("explosions/helicopter_explosion_secondary_small");
  170.    
  171.     self playsound( "nuke_explosion" );
  172.    
  173.     playFX(level.chopper_fx["explode"]["medium"], self.origin);
  174.     playFX(level.chopper_fx["explode"]["medium"], self.origin+(200,0,0));
  175.     playFX(level.chopper_fx["explode"]["medium"], self.origin);
  176.     playFX(level.chopper_fx["explode"]["medium"], self.origin+(0,200,0));
  177.     playFX(level.chopper_fx["explode"]["medium"], self.origin+(200,200,0));
  178.     playFX(level.chopper_fx["explode"]["medium"], self.origin+(0,0,200));
  179.     playFX(level.chopper_fx["explode"]["medium"], self.origin-(200,0,0));
  180.     playFX(level.chopper_fx["explode"]["medium"], self.origin-(0,200,0));
  181.     playFX(level.chopper_fx["explode"]["medium"], self.origin-(200,200,0));
  182.     playFX(level.chopper_fx["explode"]["medium"], self.origin+(0,0,400));
  183.     playFX(level.chopper_fx["explode"]["medium"], self.origin+(100,0,0));
  184.     playFX(level.chopper_fx["explode"]["medium"], self.origin+(0,100,0));
  185.     playFX(level.chopper_fx["explode"]["medium"], self.origin+(100,100,0));
  186.     playFX(level.chopper_fx["explode"]["medium"], self.origin+(0,0,100));
  187.     playFX(level.chopper_fx["explode"]["medium"], self.origin-(100,0,0));
  188.     playFX(level.chopper_fx["explode"]["medium"], self.origin-(0,100,0));
  189.     playFX(level.chopper_fx["explode"]["medium"], self.origin-(100,100,0));
  190.     playFX(level.chopper_fx["explode"]["medium"], self.origin+(0,0,100));
  191.     playfx(level.chopper_fx["explode"]["huge"], self.origin);
  192.    
  193.     level.chopper_fx["explode"]["medium"] = loadfx ("explosions/helicopter_explosion_secondary_small");
  194.    
  195.     playfx(level.chopper_fx["explode"]["medium"], self.origin);
  196.     playfx(level.chopper_fx["explode"]["huge"], self.origin);
  197.     playfx(level.chopper_fx["explode"]["medium"], self.origin);
  198.    
  199.     wait .7;
  200.    
  201.     self suicide();
  202.     self VisionSetNakedForPlayer( getDvar("mapname"), .1 );
  203.  
  204. }
  205.  
  206. //Thanks to [115]Death (aka Zombiefan564) for this part:
  207.  
  208. TextPopup( text )
  209. {
  210.     self endon( "disconnect" );
  211.     wait ( 0.05 );
  212.     self.textPopup destroy();
  213.     self notify( "textPopup" );
  214.     self endon( "textPopup" );
  215.     self.textPopup = newClientHudElem( self );
  216.     self.textPopup.horzAlign = "center";
  217.     self.textPopup.vertAlign = "middle";
  218.     self.textPopup.alignX = "center";
  219.     self.textPopup.alignY = "middle";
  220.     self.textPopup.x = 40;
  221.     self.textPopup.y = -30;
  222.     self.textPopup.font = "hudbig";
  223.     self.textPopup.fontscale = 0.69;
  224.     self.textPopup.color = (25.5, 25.5, 3.6);
  225.     self.textPopup setText(text);
  226.     self.textPopup.alpha = 0.85;
  227.     self.textPopup.glowColor = (0.3, 0.3, 0.9);
  228.     self.textPopup.glowAlpha = 0.55;
  229.     self.textPopup ChangeFontScaleOverTime( 0.1 );
  230.     self.textPopup.fontScale = 0.75;   
  231.     wait 0.1;
  232.     self.textPopup ChangeFontScaleOverTime( 0.1 );
  233.     self.textPopup.fontScale = 0.69;   
  234.     switch(randomInt(2))
  235.     {
  236.         case 0:
  237.         self.textPopup moveOverTime( 5.00 );
  238.         self.textPopup.x = 100;
  239.         self.textPopup.y = -30;
  240.         break;
  241.         case 1:
  242.         self.textPopup moveOverTime( 5.00 );
  243.         self.textPopup.x = -100;
  244.         self.textPopup.y = -30;
  245.         break;
  246.     }
  247.     wait 1;
  248.     self.textPopup fadeOverTime( 3.00 );
  249.     self.textPopup.alpha = 0;
  250. }
  251.  
  252. TextPopup2( text )
  253. {
  254.     self endon( "disconnect" );
  255.     wait ( 0.05 );
  256.     self.textPopup2 destroy();
  257.     self notify( "textPopup2" );
  258.     self endon( "textPopup2" );
  259.     self.textPopup2 = newClientHudElem( self );
  260.     self.textPopup2.horzAlign = "center";
  261.     self.textPopup2.vertAlign = "middle";
  262.     self.textPopup2.alignX = "center";
  263.     self.textPopup2.alignY = "middle";
  264.     self.textPopup2.x = 0;
  265.     self.textPopup2.y = 0;
  266.     self.textPopup2.font = "hudbig";
  267.     self.textPopup2.fontscale = 0.69;
  268.     self.textPopup2.color = (25.5, 25.5, 3.6);
  269.     self.textPopup2 setText(text);
  270.     self.textPopup2.alpha = 0.85;
  271.     self.textPopup2.glowColor = (0.3, 0.9, 0.3);
  272.     self.textPopup2.glowAlpha = 0.55;
  273.     self.textPopup2 ChangeFontScaleOverTime( 0.1 );
  274.     self.textPopup2.fontScale = 0.75;  
  275.     wait 0.1;
  276.     self.textPopup2 ChangeFontScaleOverTime( 0.1 );
  277.     self.textPopup2.fontScale = 0.69;  
  278.    
  279.     switch(randomInt(2))
  280.     {
  281.         case 0:
  282.         self.textPopup2 moveOverTime( 5.00 );
  283.         self.textPopup2.x = 100;
  284.         self.textPopup2.y = -0;
  285.         break;
  286.         case 1:
  287.         self.textPopup2 moveOverTime( 5.00 );
  288.         self.textPopup2.x = -100;
  289.         self.textPopup2.y = -0;
  290.         break;
  291.     }
  292.     wait 2;
  293.     self.textPopup2 fadeOverTime( 3.00 );
  294.     self.textPopup2.alpha = 0;
  295. }
  296.  
  297.  
  298. TextPopup21( text )
  299. {
  300.     self endon( "disconnect" );
  301.     wait ( 0.05 );
  302.     self.textPopup21 destroy();
  303.     self notify( "textPopup21" );
  304.     self endon( "textPopup21" );
  305.     self.textPopup21 = newClientHudElem( self );
  306.     self.textPopup21.horzAlign = "center";
  307.     self.textPopup21.vertAlign = "middle";
  308.     self.textPopup21.alignX = "center";
  309.     self.textPopup21.alignY = "middle";
  310.     self.textPopup21.x = 0;
  311.     self.textPopup21.y = 20;
  312.     self.textPopup21.font = "hudbig";
  313.     self.textPopup21.fontscale = 0.69;
  314.     self.textPopup21.color = (25.5, 25.5, 3.6);
  315.     self.textPopup21 setText(text);
  316.     self.textPopup21.alpha = 0.85;
  317.     self.textPopup21.glowColor = (0.3, 0.9, 0.3);
  318.     self.textPopup21.glowAlpha = 0.55;
  319.     self.textPopup21 ChangeFontScaleOverTime( 0.1 );
  320.     self.textPopup21.fontScale = 0.75; 
  321.     wait 0.1;
  322.     self.textPopup21 ChangeFontScaleOverTime( 0.1 );
  323.     self.textPopup21.fontScale = 0.69;
  324.     switch(randomInt(2))
  325.     {
  326.         case 0:
  327.         self.textPopup21 moveOverTime( 5.00 );
  328.         self.textPopup21.x = 100;
  329.         self.textPopup21.y = -20;
  330.         break;
  331.         case 1:
  332.         self.textPopup21 moveOverTime( 5.00 );
  333.         self.textPopup21.x = -100;
  334.         self.textPopup21.y = -20;
  335.         break;
  336.     }  
  337. wait 2;
  338.     self.textPopup21 fadeOverTime( 3.00 );
  339.     self.textPopup21.alpha = 0;
  340. }
  341.  
  342. TextPopup6( text )
  343. {
  344.     self endon( "disconnect" );
  345.     wait ( 0.05 );
  346.     self.textPopup6 destroy();
  347.     self notify( "textPopup6" );
  348.     self endon( "textPopup6" );
  349.     self.textPopup6 = newClientHudElem( self );
  350.     self.textPopup6.horzAlign = "CENTER";
  351.     self.textPopup6.vertAlign = "CENTER";
  352.     self.textPopup6.alignX = "CENTER";
  353.     self.textPopup6.alignY = "CENTER";
  354.     self.textPopup6.x = 80;
  355.     self.textPopup6.y = 80;
  356.     self.textPopup6.font = "hudbig";
  357.     self.textPopup6.fontscale = 0.60;
  358.     self.textPopup6.color = (25.5, 25.5, 3.6);
  359.     self.textPopup6 setText(text);
  360.     self.textPopup6.alpha = 0.85;
  361.     self.textPopup6.glowColor = (0.3, 0.3, 0.9);
  362.     self.textPopup6.glowAlpha = 0.55;
  363.  
  364.  
  365.     wait .4;
  366.     self.textPopup6 fadeOverTime( 0.50 );
  367.     self.textPopup6.alpha = 0;
  368. }
  369.  
  370. TextPopup5( text )
  371. {
  372.     self endon( "disconnect" );
  373.     wait ( 0.05 );
  374.     self.textPopup5 destroy();
  375.     self notify( "textPopup5" );
  376.     self endon( "textPopup5" );
  377.     self.textPopup5 = newClientHudElem( self );
  378.     self.textPopup5.horzAlign = "CENTERLEFT";
  379.     self.textPopup5.vertAlign = "CENTERLEFT";
  380.     self.textPopup5.alignX = "CENTERLEFT";
  381.     self.textPopup5.alignY = "CENTERLEFT";
  382.     self.textPopup5.x = 0;
  383.     self.textPopup5.y = 55;
  384.     self.textPopup5.font = "hudbig";
  385.     self.textPopup5.fontscale = 0.50;
  386.     self.textPopup5.color = (25.5, 25.5, 3.6);
  387.     self.textPopup5 setText(text);
  388.     self.textPopup5.alpha = 0.85;
  389.     self.textPopup5.glowColor = (0.3, 0.3, 0.9);
  390.     self.textPopup5.glowAlpha = 0.55;
  391.  
  392.     wait 4;
  393.     self.textPopup5 fadeOverTime( 1.00 );
  394.     self.textPopup5.alpha = 0;
  395.  
  396.  
  397. }
  398.  
  399.  
  400.  
  401.  
  402. TextPopup7( text )
  403. {
  404.     self endon( "disconnect" );
  405.     wait ( 0.05 );
  406.     self.textPopup6 destroy();
  407.     self notify( "textPopup7" );
  408.     self endon( "textPopup7" );
  409.     self.textPopup7 = newClientHudElem( self );
  410.     self.textPopup7.horzAlign = "CENTERLEFT";
  411.     self.textPopup7.vertAlign = "CENTERLEFT";
  412.     self.textPopup7.alignX = "CENTERLEFT";
  413.     self.textPopup7.alignY = "CENTERLEFT";
  414.     self.textPopup7.x = 0;
  415.     self.textPopup7.y = 25;
  416.     self.textPopup7.font = "hudbig";
  417.     self.textPopup7.fontscale = 0.50;
  418.     self.textPopup7.color = (25.5, 25.5, 3.6);
  419.     self.textPopup7 setText(text);
  420.     self.textPopup7.alpha = 0.85;
  421.     self.textPopup7.glowColor = (0.3, 0.3, 0.9);
  422.     self.textPopup7.glowAlpha = 0.55;
  423.  
  424.  
  425.     wait 6;
  426.     self.textPopup7 fadeOverTime( 1.00 );
  427.     self.textPopup7.alpha = 0;
  428. }
  429.  
  430.  
  431.  
  432. TextPopup3( text )
  433. {
  434.     self endon( "disconnect" );
  435.     wait ( 0.05 );
  436.     self.textPopup3 destroy();
  437.     self notify( "textPopup3" );
  438.     self endon( "textPopup3" );
  439.    
  440.     self.textPopup3 = newClientHudElem( self );
  441.     self.textPopup3.horzAlign = "CENTERLEFT";
  442.     self.textPopup3.vertAlign = "CENTERLEFT";
  443.     self.textPopup3.alignX = "CENTERLEFT";
  444.     self.textPopup3.alignY = "CENTERLEFT";
  445.     self.textPopup3.x = 0;
  446.     self.textPopup3.y = 40;
  447.     self.textPopup3.font = "hudbig";
  448.     self.textPopup3.fontscale = 0.50;
  449.     self.textPopup3.color = (25.5, 25.5, 3.6);
  450.     self.textPopup3 setText(text);
  451.     self.textPopup3.alpha = 0.85;
  452.     self.textPopup3.glowColor = (0.3, 0.3, 0.9);
  453.     self.textPopup3.glowAlpha = 0.55;
  454.         wait 4;
  455.     self.textPopup3 fadeOverTime( 1.00 );
  456.     self.textPopup3.alpha = 0;
  457. }
  458.  
  459. TextPopup4( text )
  460. {
  461.     self endon( "disconnect" );
  462.     wait ( 0.05 );
  463.     self.textPopup4 destroy();
  464.     self notify( "textPopup4" );
  465.     self endon( "textPopup4" );
  466.     self.textPopup4 = newClientHudElem( self );
  467.     self.textPopup4.horzAlign = "CENTERLEFT";
  468.     self.textPopup4.vertAlign = "CENTERLEFT";
  469.     self.textPopup4.alignX = "CENTERLEFT";
  470.     self.textPopup4.alignY = "CENTERLEFT";
  471.     self.textPopup4.x = 0;
  472.     self.textPopup4.y = 25;
  473.     self.textPopup4.font = "hudbig";
  474.     self.textPopup4.fontscale = 0.50;
  475.     self.textPopup4.color = (25.5, 25.5, 3.6);
  476.     self.textPopup4 setText(text);
  477.     self.textPopup4.alpha = 0.85;
  478.     self.textPopup4.glowColor = (0.3, 0.3, 0.9);
  479.     self.textPopup4.glowAlpha = 0.55;
  480.  
  481.     wait 4;
  482.     self.textPopup4 fadeOverTime( 1.00 );
  483.     self.textPopup4.alpha = 0;
  484.  
  485.  
  486. }
  487.  
  488. TextPopup9( text )
  489. {
  490.     self endon( "disconnect" );
  491.     wait ( 0.05 );
  492.     self.textPopup9 destroy();
  493.     self notify( "textPopup9" );
  494.     self endon( "textPopup9" );
  495.     self.textPopup9 = newClientHudElem( self );
  496.     self.textPopup9.horzAlign = "CENTERLEFT";
  497.     self.textPopup9.vertAlign = "CENTERLEFT";
  498.     self.textPopup9.alignX = "CENTERLEFT";
  499.     self.textPopup9.alignY = "CENTERLEFT";
  500.     self.textPopup9.x = 130;
  501.     self.textPopup9.y = 25;
  502.     self.textPopup9.font = "hudbig";
  503.     self.textPopup9.fontscale = 0.50;
  504.     self.textPopup9.color = (25.5, 25.5, 3.6);
  505.     self.textPopup9 setText(text);
  506.     self.textPopup9.alpha = 0.85;
  507.     self.textPopup9.glowColor = (0.3, 0.3, 0.9);
  508.     self.textPopup9.glowAlpha = 0.55;
  509.  
  510.  
  511.  
  512.  
  513. }
  514.  
  515. MuliKillTextPopup( text, color, glow )
  516. {
  517.     self.multikilltext destroy();
  518.     self notify( "multikilltext" );
  519.     self endon( "multikilltext" );
  520.     self.multikilltext = self createFontString( "hudbig", 0.65 );
  521.     self.multikilltext setPoint("center", "middle", 0, -165);
  522.     self.multikilltext.x = 40;
  523.     self.multikilltext.y = -30;
  524.     self.multikilltext.color = color;
  525.     self.multikilltext setText(text);
  526.     self.multikilltext.alpha = 0.85;
  527.     self.multikilltext.glowColor = glow;
  528.     self.multikilltext.glowAlpha = 0.55;
  529.  
  530.     self.multikilltext SetPulseFX( 100, 6700, 1000 );
  531. }
  532.  
  533. MuliKillTextPopup1( text, color, glow )
  534. {
  535.     self.multikilltext1 destroy();
  536.     self notify( "multikilltext1" );
  537.     self endon( "multikilltext1" );
  538.     self.multikilltext1 = self createFontString( "hudbig", 0.65 );
  539.     self.multikilltext1 setPoint("center", "middle", 0, -165);
  540.     self.multikilltext1.x = 0;
  541.     self.multikilltext1.y = 0;
  542.     self.multikilltext1.color = color;
  543.     self.multikilltext1 setText(text);
  544.     self.multikilltext1.alpha = 0.85;
  545.     self.multikilltext1.glowColor = glow;
  546.     self.multikilltext1.glowAlpha = 0.55;
  547.  
  548.     self.multikilltext1 SetPulseFX( 50, 6700, 1000 );
  549. }
  550.  
  551. MuliKillTextPopup2( text, color, glow )
  552. {
  553.     self.multikilltext12 destroy();
  554.     self notify( "multikilltext12" );
  555.     self endon( "multikilltext12" );
  556.     self.multikilltext12 = self createFontString( "hudbig", 0.65 );
  557.     self.multikilltext12 setPoint("center", "middle", 0, -165);
  558.     self.multikilltext12.x = 0;
  559.     self.multikilltext12.y = 20;
  560.     self.multikilltext12.color = color;
  561.     self.multikilltext12 setText(text);
  562.     self.multikilltext12.alpha = 0.85;
  563.     self.multikilltext12.glowColor = glow;
  564.     self.multikilltext12.glowAlpha = 0.55;
  565.  
  566.     self.multikilltext12 SetPulseFX( 50, 6700, 1000 );
  567. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement