Guest User

Untitled

a guest
Aug 13th, 2014
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.88 KB | None | 0 0
  1. weapon_endroom()
  2. {
  3.     level.weapon_trig = getEnt( "weapon_endroom_trig", "targetname"); //The trigger
  4.     jump = getEnt( "jump_weapon_origin", "targetname" ); //the origin the jumper will teleport
  5.     acti = getEnt( "activator_weapon_origin", "targetname" ); //the origin the acti will teleport
  6.  
  7.     while(1) //loop
  8.     {
  9.         level.weapon_trig waittill( "trigger", player ); //waits until the jumper activates the room
  10.         level.oldTrig delete();
  11.         level.bounceTrig delete();
  12.         level.knife_trig delete();
  13.         level.sniper_trig delete();
  14.         if( !isDefined( level.weapon_trig ) ) //defines that it is the weapon trigger
  15.         return;        
  16.  
  17.         player setOrigin( jump.origin ); //teleports the jumper
  18.         player TakeAllWeapons(); //takes all weapons from jumper
  19.         player GiveWeapon( "ak74u_mp" );
  20.         player giveMaxAmmo( "ak74u_mp" );
  21.         player GiveWeapon( "p90_mp" );
  22.         player giveMaxAmmo( "p90_mp" );
  23.         player.maxhealth = 100;
  24.         player switchToWeapon( "tomahawk_mp" );
  25.         //jumper weapon
  26.         if( isDefined( level.activ ) && isAlive( level.activ ) ) //makes sure the activator exists and is alive, otherwise it'll try to do things to a non-existant acti (._. )
  27.         {
  28.  
  29.  
  30.             level.activ setOrigin( acti.origin ); //teleports acti
  31.             level.activ TakeAllWeapons(); //takes all weapons from acti
  32.             level.activ GiveWeapon( "ak74u_mp" );
  33.             level.activ giveMaxAmmo( "ak74u_mp" );
  34.             level.activ GiveWeapon( "p90_mp" );
  35.             level.activ giveMaxAmmo( "p90_mp" );
  36.             level.activ.maxhealth = 100; //gives players normal health if damaged
  37.             level.activ SwitchToWeapon( "tomahawk_mp" ); //this line means they switch to the weapon
  38.         }
  39.          
  40.        
  41.        
  42.         wait 0.05;
  43.        
  44.         iPrintLnBold( " ^4" + player.name + " ^7has chosen ^4WEAPON ^7room!" ); // announces on screen the player name and the knife room
  45.         while( isAlive( player ) && isDefined( player ) ) //if the player is alive the room will stay closed so no one can enter.
  46.             wait 1;
  47.        
  48. }
Advertisement
Add Comment
Please, Sign In to add comment