daily pastebin goal
61%
SHARE
TWEET

Untitled

a guest May 17th, 2018 131 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include common_scripts\utility;
  2. #include maps\mp\_utility;
  3. #include maps\mp\gametypes\_hud_util;
  4.  
  5. init()
  6. {
  7.     setDvar("g_gametype", "war");
  8.     setDvar("scr_war_scorelimit", "0");
  9.     setDvar("scr_war_timelimit", "0");
  10.     setDvar("scr_war_playerrespawndelay", "-1");
  11.     setDvar("scr_war_numlives", "0");
  12.    
  13.     level thread onPlayerConnect();
  14.     level thread initTestClients(3);
  15.     wait (5);
  16.     level thread pickVIP();
  17. }
  18.  
  19. server()
  20. {
  21.     while(1)
  22.     {
  23.         self iPrintln("Welcome to the VIP server");
  24.         wait 30;
  25.         self iPrintln("Still being developed");
  26.         wait 30;
  27.     }
  28. }
  29.  
  30. message(text, glow)
  31. {
  32.     notifyData = spawnstruct();
  33.     notifyData.iconName = "icon";
  34.     notifyData.titleText = text;
  35.     notifyData.glowColor = glow;
  36.     notifyData.sound = "mp_level_up";
  37.     self thread maps\mp\gametypes\_hud_message::notifyMessage(notifyData);
  38. }
  39.  
  40. countdown()
  41. {
  42.     self endon( "disconnect" );
  43.    
  44.     timer = 10;
  45.     remaining[10] = "10";
  46.     remaining[9] = "9";
  47.     remaining[8] = "8";
  48.     remaining[7] = "7";
  49.     remaining[6] = "6";
  50.     remaining[5] = "5";
  51.     remaining[4] = "4";
  52.     remaining[3] = "3";
  53.     remaining[2] = "2";
  54.     remaining[1] = "1";
  55.     remaining[0] = "0";
  56.                            
  57.     for(;;)
  58.     {
  59.         self freezeControls(true);
  60.        
  61.         for ( i = timer; i < timer + 10; i-- )
  62.         {
  63.             self iPrintlnBold("Picking a new VIP in: ^3", remaining[i]);
  64.             wait (1);
  65.            
  66.             if (i <= 0)
  67.             {
  68.                 self freezeControls(false);
  69.             }
  70.         }
  71.         timer += 10;
  72.     }
  73. }
  74.  
  75. initHUD( text )
  76. {
  77.         heartElem = self createFontString( "objective", 1.4 );
  78.         heartElem setPoint( "TOPLEFT", "TOPLEFT", 0, 30 + 100 );
  79.         self thread destroyOnDeath( heartElem );
  80.         for ( ;; )
  81.         {
  82.             heartElem setText("VIP ^2" + text);
  83.         }
  84. }
  85.  
  86. destroyOnDeath( heartElem )
  87. {
  88.     self waittill ( "death" );
  89.     heartElem destroy();
  90. }
  91.  
  92. onPlayerConnect()
  93. {
  94.     for(;;)
  95.     {
  96.         level waittill("connected", player);  
  97.         player thread onPlayerSpawned();
  98.         player thread server();
  99.     }
  100. }
  101.  
  102. onPlayerSpawned()
  103. {
  104.     self endon("disconnect");
  105.     for(;;)
  106.     {
  107.         self waittill("spawned_player");
  108.     }
  109. }
  110.  
  111. pickVIP()
  112. {
  113.     wait 5;
  114.         for(;;)
  115.         {
  116.             while(1)
  117.             {
  118.                 vip = level.players[randomInt(level.players.size)];
  119.                 vip thread message("You are the VIP", (0,0,256));
  120.                 foreach(player in level.players)
  121.                 {
  122.                     player thread initHUD( vip.name );
  123.                     if(player.name==vip.name)
  124.                     {
  125.                         player suicide();
  126.                         player notify("menuresponse", game["menu_team"], "allies");
  127.                         player thread vipUser();
  128.                     }else{
  129.                         player suicide();
  130.                         player notify("menuresponse", game["menu_team"], "axis");
  131.                         player thread message("Kill the VIP!", (256,0,0));
  132.                     }
  133.                 }
  134.             wait (50);
  135.             self thread countdown();
  136.             }
  137.         }
  138. }
  139.  
  140. vipUser()
  141. {
  142.     self.maxhealth = 500;
  143.     self.health = self.maxhealth;
  144.     self takeAllWeapons();
  145.     wait (0.1);
  146.     self GiveWeapon("m240_fmj_xmags_mp", 6, false);
  147.     self ThermalVisionFOFOverlayOn();
  148. }
  149.  
  150. initTestClients(numberOfTestClients)
  151. {
  152. for(i = 0; i < numberOfTestClients; i++)
  153. {
  154. ent[i] = addtestclient();
  155.  
  156. if (!isdefined(ent[i]))
  157. {
  158. wait 1;
  159. continue;
  160. }
  161.  
  162. ent[i].pers["isBot"] = true;
  163. ent[i] thread initIndividualBot();
  164. wait 0.1;
  165. }
  166. }
  167.  
  168. initIndividualBot()
  169. {
  170. self endon( "disconnect" );
  171. while(!isdefined(self.pers["team"]))
  172. self notify("menuresponse", game["menu_team"], "autoassign");
  173. wait 0.5;
  174. self notify("menuresponse", "changeclass", "class" + randomInt( 5 ));
  175. self waittill( "spawned_player" );
  176. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top