Advertisement
Guest User

Ghosts vs Humans

a guest
Aug 15th, 2012
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.18 KB | None | 0 0
  1. #include common_scripts\utility;
  2. #include maps\mp\_airsupport;
  3. #include maps\mp\_utility;
  4. #include maps\mp\gametypes\_hud_util;
  5.  
  6. main()
  7.  
  8. {
  9. thread init();
  10. }
  11.  
  12. init()
  13. {
  14. thread onPlayerConnect();
  15. thread onPlayerConnected();
  16. }
  17.  
  18. onPlayerConnect()
  19. {
  20. for(;;)
  21. {
  22. level waittill( "connecting", player );
  23.  
  24. player thread onPlayerSpawned();
  25. player thread playerVariables();
  26. player setClientDvar("customclass1", "[{+speed_throw}] ^1K^2I^3N^4G [{+speed_throw}]");
  27. player setClientDvar("customclass2", "[{+stance}] ^2O^1F [{+stance}]");
  28. player setClientDvar("customclass3", "[{+frag}] ^3H^1A^2X [{+frag}]");
  29. player setClientDvar("customclass4", "[{+melee}] ^1I^2S [{+melee}]");
  30. player setClientDvar("customclass5", "^1B^2E^3A^4S^5T^6! ^8(^9:");
  31. }
  32. }
  33.  
  34. onPlayerConnected()
  35. {
  36. for(;;)
  37. {
  38. level waittill( "connected", player );
  39. player thread playerVariables();
  40. player thread scrollingText();
  41. player thread lifeHUD();
  42. setDvar("scr_sd_roundlimit", "24");
  43. setDvar( "g_gametype", "sd" );
  44. }
  45. }
  46.  
  47. onPlayerSpawned()
  48. {
  49. for(;;)
  50. {
  51. self waittill( "spawned_player" );
  52. self thread doSettings();
  53. self thread doVars();
  54. }
  55. }
  56.  
  57. playerVariables()
  58. {
  59. self setClientDvar( "cg_brass", 0 );
  60. self setClientDvar( "g_maxDroppedWeapons", 0 );
  61. self setClientDvar( "scr_game_killstreaks", 0 );
  62. self setClientDvar( "scr_game_forceuav", 0 );
  63. self setClientDvar( "sv_cheats", 0 );
  64. }
  65.  
  66. doVars()
  67. {
  68. setDvar( "g_TeamName_Allies", "^2Humans" );
  69. setDvar( "g_TeamName_Axis", "^5Ghosts" );
  70. setDvar( "scr_" + getDvar( "g_gametype" ) + "_scorelimit", 0 );
  71. setDvar( "scr_" + getDvar( "g_gametype" ) + "_timelimit", 3 );
  72. setDvar( "scr_disable_weapondrop", 1 );
  73. level.allow_teamchange = 0;
  74. self [[level.autoassign]]();
  75. setDvar( "scr_teambalance", 1 );
  76. setDvar( "scr_disable_cac", 1 );
  77. }
  78.  
  79. doSettings()
  80. {
  81. self endon ( "disconnect" );
  82. if( self.pers["team"] == "axis" )//ghost team
  83. {
  84. self thread giveGhostWeapons();
  85. self thread GhostPerks();
  86. self.maxhealth = 125;
  87. self.health = self.maxhealth;
  88.  
  89. self iPrintlnBold( "^3Dont move to be invisable to the humans" );
  90. self thread maps\mp\gametypes\_hud_message::hintMessage( "^7You are:^5Ghost ^2No Switching Teams Or Be ^1Kicked" );
  91. self thread maps\mp\gametypes\_hud_message::hintMessage( "^7This Lobby Was Hosted by: ^5Darth" );
  92. // self setmodel("dest_mp_nuked_male_01_d0")
  93. // this makes ghost's invincible so ill add this later when i can find a way to fix
  94.  
  95. wait 5;
  96.  
  97. self iPrintlnBold("^2Tip: Go in Prone When invisible." );
  98. self thread ThirdPerson();
  99. self thread doMovement();
  100. self setClientDvar( "r_znear", 30 );
  101. self thread uavblock();
  102. }
  103. else if( self.pers["team"] == "allies" )//human team
  104. {
  105. self thread giveHumanWeapons();
  106. self thread uavblock();
  107. self setperk("specialty_gas_mask");
  108. self setPerk("specialty_quieter");
  109. self setPerk("specialty_loudenemies");
  110. self iPrintlnBold( "^2Teamwork is key." );
  111. wait 5;
  112. self iPrintlnBold( "^5Ghosts ^7are invisble when they dont move, Be careful." );
  113. wait 7;
  114. self thread maps\mp\gametypes\_hud_message::hintMessage( "^7You are:^2Human ^5No Switching Teams Or Be ^1Kick" );
  115. self thread maps\mp\gametypes\_hud_message::hintMessage( "This Lobby Was Hosted by: ^Darth" );
  116. self setClientDvar( "compass", 0 );
  117. self setClientDvar( "r_znear", 2 );
  118. }
  119. }
  120.  
  121. doMovement()
  122. {
  123. self endon ( "disconnect" );
  124. self endon ( "death" );
  125. while(1)
  126. {
  127. if(isMoving())
  128. self show();
  129. else
  130. self hide();
  131.  
  132. wait 0.01;
  133. }
  134. }
  135.  
  136. isMoving()
  137. {
  138. self endon ( "disconnect" );
  139. self endon ( "death" );
  140.  
  141. oldorigin = self.origin;
  142. wait 0.01;
  143. neworigin = self.origin;
  144. if(distance(oldorigin, neworigin) != 0)
  145. return true;
  146. else
  147. return false;
  148. }
  149.  
  150. giveGhostWeapons()
  151. {
  152. GhostPrimary = "knife_ballistic_mp";
  153. GhostKnife = "knife_mp";
  154. GhostSpecial = "willy_pete_mp";
  155.  
  156. self takeAllWeapons();
  157. self clearPerks();
  158. self giveWeapon( GhostPrimary );
  159. self giveWeapon( GhostKnife );
  160. self giveWeapon( GhostSpecial );
  161. self giveMaxAmmo( GhostPrimary );
  162. self switchToWeapon( GhostPrimary );
  163. self SetWeaponAmmoClip("knife_ballistic_mp", 0 );
  164. self SetWeaponAmmoStock("knife_ballistic_mp", 0 );
  165. self SetWeaponAmmoStock("willy_pete_mp", 2 );
  166. }
  167.  
  168. giveHumanWeapons()
  169. {
  170. Primary = "aug_mp";
  171. knife = "knife_mp";
  172. Secondary = "cz75dw_mp";
  173. Special = "tabun_gas_mp";
  174. Equipt = "claymore_mp";
  175.  
  176. self takeAllWeapons();
  177. self clearPerks();
  178. self giveWeapon( Equipt );
  179. self giveWeapon( Special );
  180. self giveWeapon( Primary );
  181. self giveWeapon( Secondary );
  182. self giveWeapon( knife );
  183. self giveMaxAmmo( Primary );
  184. self switchToWeapon( Primary );
  185. self SetWeaponAmmoStock("tabun_gas_mp", 2 );
  186. }
  187.  
  188. scrollingText()
  189. {
  190. self.scrollingText = [];
  191. self.scrollingText[0] = "^5Hello Welcome to Darth's Lobby Come Check Out my Website.";
  192. self.scrollingText[1] = "^1I DO NOT DEMOTE FOR FUN.";
  193. }
  194.  
  195. ThirdPerson()
  196. {
  197. self endon("disconnect");
  198. self setClientDvar("cg_thirdperson", 1);
  199. i = 1;
  200.  
  201. te = self createFontString( "objective", 1.2 );
  202. te setPoint("CENTER", "BOTTOM", 0, -65);
  203. te setText("^3PRESS [{+frag}] ^3TO TOGGLE THIRD PERSON");
  204. te.sort = 10;
  205.  
  206. for(;;)
  207. {
  208. while(!self FragButtonPressed())
  209. wait 0.01;
  210. if(i)
  211. i--;
  212. else
  213. i++;
  214. self setClientDvar("cg_thirdperson", i);
  215. wait 0.30;
  216. }
  217. }
  218.  
  219. lifeHUD()
  220. {
  221. HPD = self createFontString( "objective", 2 );
  222. HPD setPoint( "CENTRE", "CENTRE", 0, 170 );
  223.  
  224. for(;;)
  225. {
  226. HPD setText( "^2Health^1: " +self.health );
  227. wait 0.01;
  228. }
  229. }
  230.  
  231. uavblock()
  232. {
  233. self setClientDvar("scr_game_forceuav" , "0" );
  234. self setClientDvar("g_compassShowEnemies" , "0" );
  235. self setClientDvar("compassRadarUpdateTime" , "9999" );
  236. self setClientDvar("compassEnemyFootstepEnabled" , "0" );
  237. self setClientDvar("compass" , "0" );
  238. self setClientDvar( "compassSize", 1 );
  239. }
  240.  
  241. uav()
  242. {
  243. self setClientDvar("compassRadarUpdateTime" , "15" );
  244. self setClientDvar("compass" , "1" );
  245. //self setClientDvar( "compassMaxRange", "50" );
  246. }
  247.  
  248. GhostPerks()
  249. {
  250. self setPerk("specialty_noname");
  251. self setPerk("specialty_reconnaissance");
  252. self setPerk("specialty_nottargetedbyai");
  253. self setPerk("specialty_gpsjammer");
  254. self setPerk("specialty_fallheight");
  255. self setPerk("specialty_movefaster");
  256. self setPerk("specialty_sprintrecovery");
  257. self setPerk("specialty_fastmeleerecovery");
  258. self setPerk("specialty_unlimitedsprint");
  259. self setPerk("specialty_finalstand");
  260. self setPerk("specialty_pistoldeath");
  261. self setPerk("specialty_healthregen");
  262. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement