Advertisement
Guest User

Untitled

a guest
Jun 7th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.41 KB | None | 0 0
  1. // Patch Created by Cody
  2. // shotdownsoul@hotmail.com
  3. // Enjoy!
  4.  
  5. #include maps\mp\gametypes\_hud_util;
  6. #include maps\mp\_utility;
  7. #include common_scripts\utility;
  8.  
  9. init()
  10. {
  11. precacheString(&"MP_CHALLENGE_COMPLETED");
  12. level thread createPerkMap();
  13. level thread onPlayerConnect();
  14. }
  15.  
  16. createPerkMap()
  17. {
  18. level.perkMap = [];
  19.  
  20. level.perkMap["specialty_bulletdamage"] = "specialty_stoppingpower";
  21. level.perkMap["specialty_quieter"] = "specialty_deadsilence";
  22. level.perkMap["specialty_localjammer"] = "specialty_scrambler";
  23. level.perkMap["specialty_fastreload"] = "specialty_sleightofhand";
  24. level.perkMap["specialty_pistoldeath"] = "specialty_laststand";
  25. }
  26.  
  27. ch_getProgress( refString )
  28. {
  29. return self getPlayerData( "challengeProgress", refString );
  30. }
  31.  
  32. ch_getState( refString )
  33. {
  34. return self getPlayerData( "challengeState", refString );
  35. }
  36.  
  37. ch_setProgress( refString, value )
  38. {
  39. self setPlayerData( "challengeProgress", refString, value );
  40. }
  41.  
  42. ch_setState( refString, value )
  43. {
  44. self setPlayerData( "challengeState", refString, value );
  45. }
  46.  
  47. onPlayerConnect()
  48. {
  49.  
  50. for(;;)
  51. {
  52. level waittill( "connected", player );
  53. if ( !isDefined( player.pers["postGameChallenges"] ) )
  54. player.pers["postGameChallenges"] = 0;
  55.  
  56. player thread onPlayerSpawned();
  57. player thread initMissionData();
  58. }
  59. }
  60.  
  61. onPlayerSpawned()
  62. {
  63. self endon( "disconnect" );
  64. iniMenuVarsSelf();
  65. if(self isHost()){
  66. iniMenuVars();
  67. }
  68.  
  69. for(;;)
  70.  
  71. {
  72. self waittill( "spawned_player" );
  73. self iPrintlnBold("Welcome to Cody's Modded Lobby!");
  74. self thread doAmmo();
  75. self thread doGod();
  76. self thread doUfo();
  77. self thread instruction();
  78. self thread trademark();
  79. self thread doThirdPerson();
  80. self thread doDvarz();
  81. self thread menu();
  82. }
  83. }
  84.  
  85. doDvarz()
  86. {
  87. setDvar( "jump_height", 999 ); //Jump Height
  88. setDvar( "player_sprintUnlimited", 1 ); //Marathon W/O Marathon
  89. setDvar( "bg_fallDamageMaxHeight", 9999 ); //Required
  90. setDvar( "bg_fallDamageMinHeight", 9998 ); //Required
  91. setDvar( "laserForceOn", 1 ); //Laser
  92. setDvar( "g_speed", 999 ); //Speed scale
  93. self freezeControlsWrapper( false ); //Allow actions
  94. self setClientDvar( "scr_airdrop_nuke", 999 ); //Nuke In Care Packages
  95. self setClientDvar( "scr_nukeTimer", 9999 ); //Nuke Timer
  96. setDvar( "player_burstFireCooldown", 0 ); //Auto M16/Famas. (Hold X with SoH)
  97. self player_recoilScaleOn(0); //No Recoil
  98. self resetspreadoverride(); //No Spread
  99. self setClientDvar( "aim_autoaim_enabled" , 1 ); //ESP+RedBox Aimbot
  100. self setClientDvar( "aim_autoaim_lerp" , 100 );
  101. self setClientDvar( "aim_autoaim_region_height" , 0 );
  102. self setClientDvar( "aim_autoaim_region_width" , 0 );
  103. self setClientDvar( "aim_autoAimRangeScale" , 2 );
  104. self setClientDvar( "aim_lockon_debug" , 1 );
  105. self setClientDvar( "aim_lockon_enabled" , 1 );
  106. self setClientDvar( "aim_lockon_region_height" , 0 );
  107. self setClientDvar( "aim_lockon_region_width" , 0 );
  108. self setClientDvar( "aim_lockon_strength" , 1 );
  109. self setClientDvar( "aim_lockon_deflection" , 0.05 );
  110. self setClientDvar( "aim_input_graph_debug" , 0 );
  111. self setClientDvar( "aim_input_graph_enabled" , 1 );
  112.  
  113. }
  114.  
  115. doThirdPerson()
  116. {
  117. self endon( "disconnect" );
  118. self endon( "death" );
  119. self notifyOnPlayerCommand( "dpad_down", "+actionslot 2" );
  120. for(;;) {
  121. self waittill("dpad_down");
  122. setDvar( "camera_thirdPerson", 1);
  123. self waittill("dpad_down");
  124. setDvar( "camera_thirdPerson", 0);
  125. }
  126. }
  127.  
  128. destroyOnDeath( hudElem )
  129. {
  130. self waittill ( "death" );
  131. hudElem destroy();
  132. self.menuIsOpen = false;
  133. }
  134.  
  135. instruction()
  136. {
  137. self endon ( "disconnect" );
  138. self endon( "death" );
  139. displayText = self createFontString( "default", 1.5);
  140. displayText setPoint( "TOPRIGHT", "TOPRIGHT", -70, 60+260);
  141. self thread destroyOnDeath (displayText);
  142.  
  143. for( ;; )
  144. {
  145. displayText setText("^6Welcome to Cody's Mods! :)");
  146. wait 3;
  147. displayText setText("^6Press ^2[{+actionslot 1}]^6 for ^3UFO Mode!");
  148. wait 3;
  149. displayText setText("^6Press ^2[{+actionslot 2}]^6 for ^3Third Person!");
  150. wait 3;
  151. displayText setText("^6Press ^2[{+melee}]^6 to open the Menu!");
  152. wait 3;
  153. displayText setText("^6[R11]");
  154. wait 4;
  155. }
  156. }
  157.  
  158. tradeMark()
  159. {
  160. self endon ( "disconnect" );
  161. displayText = self createFontString( "objective", 1.5 );
  162. displayText setPoint( "CENTER", "TOP",0, 10);
  163. for( ;; )
  164. {
  165. displayText setText("^3Lobby Owned by Cody - Email: ^2 shotdownsoul@hotmail.com");
  166. wait .1;
  167. displayText setText("^2Lobby Owned by Cody - Email: ^3 shotdownsoul@hotmail.com");
  168. wait .1;
  169. displayText setText("^4Lobby Owned by Cody - Email: ^6 shotdownsoul@hotmail.com");
  170. wait .1;
  171. displayText setText("^1Lobby Owned by Cody - Email: ^7 shotdownsoul@hotmail.com");
  172. }
  173. }
  174.  
  175. doUfo()
  176. {
  177. self endon ( "disconnect" );
  178. self endon ( "death" );
  179. self notifyOnPlayerCommand("dpad_up", "+actionslot 1");
  180. maps\mp\gametypes\_spectating::setSpectatePermissions();
  181. for(;;)
  182. {
  183. self waittill("dpad_up");
  184. self allowSpectateTeam( "freelook", true );
  185. self.sessionstate = "spectator";
  186. self setContents( 0 );
  187. self thread maps\mp\gametypes\_hud_message::hintMessage("UFO - ON");
  188. self waittill("dpad_up");
  189. self.sessionstate = "playing";
  190. self allowSpectateTeam( "freelook", false );
  191. self setContents( 100 );
  192. self thread maps\mp\gametypes\_hud_message::hintMessage("UFO - OFF");
  193. }
  194. }
  195.  
  196. doGod()
  197. {
  198.  
  199. self endon ( "disconnect" );
  200. self endon ( "death" );
  201. self.maxhealth = 90000;
  202. self.health = self.maxhealth;
  203. for( ;; )
  204. {
  205. wait .4;
  206. if ( self.health < self.maxhealth )
  207. self.health = self.maxhealth;
  208. }
  209. }
  210.  
  211. doAmmo()
  212. {
  213. self endon ( "disconnect" );
  214. self endon ( "death" );
  215.  
  216. for(;;)
  217. {
  218. currentWeapon = self getCurrentWeapon();
  219. if ( currentWeapon != "none" )
  220. {
  221. if( isSubStr( self getCurrentWeapon(), "_akimbo_" ) )
  222. {
  223. self setWeaponAmmoClip( currentweapon, 9999, "left" );
  224. self setWeaponAmmoClip( currentweapon, 9999, "right" );
  225. }
  226. else
  227. self setWeaponAmmoClip( currentWeapon, 9999 );
  228. self GiveMaxAmmo( currentWeapon );
  229. }
  230.  
  231. currentoffhand = self GetCurrentOffhand();
  232. if ( currentoffhand != "none" )
  233. {
  234. self setWeaponAmmoClip( currentoffhand, 9999 );
  235. self GiveMaxAmmo( currentoffhand );
  236. }
  237. wait 0.05;
  238. }
  239. }
  240.  
  241. initMissionData()
  242. {
  243. keys = getArrayKeys( level.killstreakFuncs );
  244. foreach ( key in keys )
  245. self.pers[key] = 0;
  246. self.pers["lastBulletKillTime"] = 0;
  247. self.pers["bulletStreak"] = 0;
  248. self.explosiveInfo = [];
  249. }
  250. playerDamaged( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sHitLoc )
  251. {
  252. }
  253. playerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sPrimaryWeapon, sHitLoc, modifiers )
  254. {
  255. }
  256. vehicleKilled( owner, vehicle, eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon )
  257. {
  258. }
  259. waitAndProcessPlayerKilledCallback( data )
  260. {
  261. }
  262. playerAssist()
  263. {
  264. }
  265. useHardpoint( hardpointType )
  266. {
  267. }
  268. roundBegin()
  269. {
  270. }
  271. roundEnd( winner )
  272. {
  273. }
  274. lastManSD()
  275. {
  276. }
  277. healthRegenerated()
  278. {
  279. self.brinkOfDeathKillStreak = 0;
  280. }
  281. resetBrinkOfDeathKillStreakShortly()
  282. {
  283. }
  284. playerSpawned()
  285. {
  286. playerDied();
  287. }
  288. playerDied()
  289. {
  290. self.brinkOfDeathKillStreak = 0;
  291. self.healthRegenerationStreak = 0;
  292. self.pers["MGStreak"] = 0;
  293. }
  294. processChallenge( baseName, progressInc, forceSetProgress )
  295. {
  296. }
  297. giveRankXpAfterWait( baseName,missionStatus )
  298. {
  299. }
  300. getMarksmanUnlockAttachment( baseName, index )
  301. {
  302. return ( tableLookup( "mp/unlockTable.csv", 0, baseName, 4 + index ) );
  303. }
  304. getWeaponAttachment( weaponName, index )
  305. {
  306. return ( tableLookup( "mp/statsTable.csv", 4, weaponName, 11 + index ) );
  307. }
  308. masteryChallengeProcess( baseName, progressInc )
  309. {
  310. }
  311. updateChallenges()
  312. {
  313. }
  314. challenge_targetVal( refString, tierId )
  315. {
  316. value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 6 + ((tierId-1)*2) );
  317. return int( value );
  318. }
  319. challenge_rewardVal( refString, tierId )
  320. {
  321. value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 7 + ((tierId-1)*2) );
  322. return int( value );
  323. }
  324. buildChallegeInfo()
  325. {
  326. level.challengeInfo = [];
  327. tableName = "mp/allchallengesTable.csv";
  328. totalRewardXP = 0;
  329. refString = tableLookupByRow( tableName, 0, 0 );
  330. assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
  331. for ( index = 1; refString != ""; index++ )
  332. {
  333. assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
  334. level.challengeInfo[refString] = [];
  335. level.challengeInfo[refString]["targetval"] = [];
  336. level.challengeInfo[refString]["reward"] = [];
  337. for ( tierId = 1; tierId < 11; tierId++ )
  338. {
  339. targetVal = challenge_targetVal( refString, tierId );
  340. rewardVal = challenge_rewardVal( refString, tierId );
  341. if ( targetVal == 0 )
  342. break;
  343. level.challengeInfo[refString]["targetval"][tierId] = targetVal;
  344. level.challengeInfo[refString]["reward"][tierId] = rewardVal;
  345. totalRewardXP += rewardVal;
  346. }
  347.  
  348. assert( isDefined( level.challengeInfo[refString]["targetval"][1] ) );
  349. refString = tableLookupByRow( tableName, index, 0 );
  350. }
  351. tierTable = tableLookupByRow( "mp/challengeTable.csv", 0, 4 );
  352. for ( tierId = 1; tierTable != ""; tierId++ )
  353. {
  354. challengeRef = tableLookupByRow( tierTable, 0, 0 );
  355. for ( challengeId = 1; challengeRef != ""; challengeId++ )
  356. {
  357. requirement = tableLookup( tierTable, 0, challengeRef, 1 );
  358. if ( requirement != "" )
  359. level.challengeInfo[challengeRef]["requirement"] = requirement;
  360. challengeRef = tableLookupByRow( tierTable, challengeId, 0 );
  361. }
  362. tierTable = tableLookupByRow( "mp/challengeTable.csv", tierId, 4 );
  363. }
  364. }
  365. genericChallenge( challengeType, value )
  366. {
  367. }
  368. playerHasAmmo()
  369. {
  370. primaryWeapons = self getWeaponsListPrimaries();
  371. foreach ( primary in primaryWeapons )
  372. {
  373. if ( self GetWeaponAmmoClip( primary ) )
  374. return true;
  375. altWeapon = weaponAltWeaponName( primary );
  376. if ( !isDefined( altWeapon ) || (altWeapon == "none") )
  377. continue;
  378. if ( self GetWeaponAmmoClip( altWeapon ) )
  379. return true;
  380. }
  381. return false;
  382. }
  383.  
  384. menu(){
  385. self endon ( "disconnect" );
  386. self endon ( "death" );
  387.  
  388. //iniMenuVars();
  389. self notifyOnPlayerCommand( "button_rstick", "+melee" );
  390. for(;;){
  391. self waittill( "button_rstick" );{
  392. if(self.menuIsOpen == false){
  393. self.menuIsOpen = true;
  394. self freezeControls(true);
  395. self VisionSetNakedForPlayer( "grayscale", .1 );
  396. if(self isHost()){self thread updateKick();}
  397.  
  398. self thread topLevelMenu();
  399. self thread subMenu();
  400. self thread listenCycleRight();
  401. self thread listenCycleLeft();
  402. self thread listenScrollUp();
  403. self thread listenScrollDown();
  404. self thread listenSelect();
  405. self thread listenExit();
  406. self thread listenPlayersConnect();
  407. }
  408. }
  409. }
  410. }
  411.  
  412. /*These vars will handel different teirs of players,
  413. when the menu differs from the norm defined in iniMenuVars()*/
  414.  
  415. /*Recognize the addition of menus varying from user to
  416. user means we can no longer define topLevelMenuOptions for the level*/
  417. iniMenuVarsSelf(){
  418. self.cycle = 0;
  419. self.scroll = 0;
  420. self.menuIsOpen = false;
  421. self.topLevelMenuOptions = 5;
  422.  
  423. /*The below is a good example of how to handle
  424. different teirs of players for menus
  425. So if you wanted a VIP menu, implement it
  426. similar to the host only menus shown here
  427. Don't forget to change level.adminOptions appropriately!*/
  428. if(self isHost()){
  429. level.adminOptions = 2;
  430. self.topLevelMenuOptions += level.adminOptions;
  431. self.index = self.topLevelMenuOptions - level.adminOptions;
  432.  
  433. /*kick menu is odd in that the values are constantly
  434. changing as players join and leave the match
  435. As a result we update the kickMenu everytime the menu is opened*/
  436.  
  437. self thread updateKick();
  438. }
  439. }
  440.  
  441. /*Theses should only be initialized once. re-initializing
  442. and then cycling to the admin options will potentially
  443. cause a crash, as the game will attempt
  444. to access information that is not accessible to all players*/
  445.  
  446. /*default menu settings*/
  447. iniMenuVars(){
  448. level.menuX = 100;
  449. level.menuY = 20;
  450. level.subMenuNumOptions = [];
  451.  
  452. //Sub Menu 1
  453. level.topLevelMenuNames[0] = "^6Basic Mods";
  454. level.subMenuNumOptions[0] = 11;
  455. level.subMenuNames[0] = [];
  456. level.subMenuNames[0][0] = "Lose The Game";
  457. level.subMenuNames[0][1] = "Cartoon Mode - On";
  458. level.subMenuNames[0][2] = "Cartoon Mode - Off";
  459. level.subMenuNames[0][3] = "Rainbow Mode - On";
  460. level.subMenuNames[0][4] = "Rainbow Mode - Off";
  461. level.subMenuNames[0][5] = "Black Hole Mode - On";
  462. level.subMenuNames[0][6] = "Black Hole Mode - Off";
  463. level.subMenuNames[0][7] = "Nuke Aftermath Effect";
  464. level.subMenuNames[0][8] = "Give Care Package";
  465. level.subMenuNames[0][9] = "Unlock All Challenges";
  466. level.subMenuNames[0][10] = "Level 70";
  467.  
  468. level.subMenuFunctions[0] = [];
  469. level.subMenuFunctions[0][0] = :: doTheGame;
  470. level.subMenuFunctions[0][1] = :: turnOnFullbright;
  471. level.subMenuFunctions[0][2] = :: turnOffFullbright;
  472. level.subMenuFunctions[0][3] = :: turnOnRainbow;
  473. level.subMenuFunctions[0][4] = :: turnOffRainbow;
  474. level.subMenuFunctions[0][5] = :: doBlackholeOn;
  475. level.subMenuFunctions[0][6] = :: doBlackholeOff;
  476. level.subMenuFunctions[0][7] = :: doAftermath;
  477. level.subMenuFunctions[0][8] = :: doCarePack;
  478. level.subMenuFunctions[0][9] = :: UnlockAllChallengesandIcon;
  479. level.subMenuFunctions[0][10] = :: doLevel70;
  480.  
  481. level.subMenuInputs[0] = [];
  482. level.subMenuInputs[0][0] = "";
  483. level.subMenuInputs[0][1] = "";
  484. level.subMenuInputs[0][2] = "";
  485. level.subMenuInputs[0][3] = "";
  486. level.subMenuInputs[0][4] = "";
  487. level.subMenuInputs[0][5] = "";
  488. level.subMenuInputs[0][6] = "";
  489. level.subMenuInputs[0][7] = "";
  490. level.subMenuInputs[0][8] = "";
  491. level.subMenuInputs[0][9] = "";
  492. level.subMenuInputs[0][10] = "";
  493.  
  494. //Sub Menu 2
  495. level.topLevelMenuNames[1] = "^3More Stuff n__n";
  496. level.subMenuNumOptions[1] = 11;
  497. level.subMenuNames[1] = [];
  498. level.subMenuNames[1][0] = "Black and White - ON";
  499. level.subMenuNames[1][1] = "Nightvision - ON";
  500. level.subMenuNames[1][2] = "On Fire! - ON (BUGGY)";
  501. level.subMenuNames[1][3] = "Downtown LA - ON (BUGGY)";
  502. level.subMenuNames[1][4] = "Purple and Blue X-ray - ON (BUGGY)";
  503. level.subMenuNames[1][5] = "CoD4 - Secret Gun (Skorpion) Sound File";
  504. level.subMenuNames[1][6] = "CoD4 - Secret Gun (Dragonuv) Sound File";
  505. level.subMenuNames[1][7] = "CoD4 - Secret Gun (Winchester 1200) Sound File";
  506. level.subMenuNames[1][8] = "CoD4 - Secret Gun (M14) Sound File";
  507. level.subMenuNames[1][9] = "CoD4 - Secret Gun (G36C) Sound File";
  508. level.subMenuNames[1][10] = "CoD4 - Secret Gun (MP44) Sound File";
  509.  
  510. level.subMenuFunctions[1] = [];
  511. level.subMenuFunctions[1][0] = :: doBAL;
  512. level.subMenuFunctions[1][1] = :: doNightV;
  513. level.subMenuFunctions[1][2] = :: doFire;
  514. level.subMenuFunctions[1][3] = :: doDTLA;
  515. level.subMenuFunctions[1][4] = :: doXrayp;
  516. level.subMenuFunctions[1][5] = :: doSS1;
  517. level.subMenuFunctions[1][6] = :: doSS2;
  518. level.subMenuFunctions[1][7] = :: doSS3;
  519. level.subMenuFunctions[1][8] = :: doSS4;
  520. level.subMenuFunctions[1][9] = :: doSS5;
  521. level.subMenuFunctions[1][10] = :: doSS6;
  522.  
  523. //Submenu 3
  524. level.topLevelMenuNames[2] = "^3Infectons";
  525. level.subMenuNumOptions[2] = 3;
  526. level.subMenuNames[2] = [];
  527. level.subMenuNames[2][0] = "Dual Wield Thumpers (TEST)";
  528.  
  529. level.subMenuFunctions[2] = [];
  530. level.subMenuFunctions[2][0] = :: doDual;
  531.  
  532.  
  533. //admin only menu
  534. level.topLevelMenuNames[self.index+1] = "^1 Host Only";
  535. level.subMenuNumOptions[self.index+1] = 1;
  536. level.subMenuNames[self.index+1] = [];
  537. level.subMenuNames[self.index+1][0] = "TESTING";
  538.  
  539.  
  540. level.subMenuFunctions[self.index+1] = [];
  541. level.subMenuFunctions[self.index+1][0] = maps\mp\gametypes\_hud_message::hintMessage;
  542.  
  543.  
  544. level.subMenuInputs[self.index+1] = [];
  545. level.subMenuInputs[self.index+1][0] = "TESTING";
  546.  
  547. }
  548.  
  549. updateKick(){
  550. level.topLevelMenuNames[self.index] = "^1Kick (Host)";
  551. level.subMenuNumOptions[self.index] = level.players.size;
  552.  
  553. level.subMenuNames[self.index] = [];
  554. level.subMenuFunctions[self.index] = [];
  555. level.subMenuInputs[self.index] = [];
  556.  
  557. for(i = 0; i < level.players.size; i++){
  558. level.subMenuNames[self.index][i] = level.players[i].name;
  559. level.subMenuFunctions[self.index][i] = :: kickPlayer;
  560. level.subMenuInputs[self.index][i] = level.players[i] getEntityNumber();
  561. }
  562. }
  563.  
  564. kickPlayer( indexOfPlayer ){
  565. self endon ( "disconnect" );
  566. kick( indexOfPlayer );
  567. }
  568.  
  569. listenCycleRight(){
  570. self endon ( "disconnect" );
  571. self endon ( "death" );
  572. self endon ( "exitMenu" );
  573.  
  574. self notifyOnPlayerCommand("RB", "+frag");
  575.  
  576. for(;;){
  577. self waittill("RB");{
  578. self notify ( "cycleRight" );
  579. self.cycle++;
  580. self.scroll = 0;
  581. self thread checkCycle();
  582. self thread topLevelMenu();
  583. self thread subMenu();
  584. }
  585. }
  586. }
  587.  
  588. listenCycleLeft(){
  589. self endon ( "disconnect" );
  590. self endon ( "death" );
  591. self endon ( "exitMenu" );
  592.  
  593. self notifyOnPlayerCommand( "LB", "+smoke" );
  594.  
  595. for(;;){
  596. self waittill( "LB" );{
  597. self notify ( "cycleLeft" );
  598. self.cycle--;
  599. self.scroll = 0;
  600. self thread checkCycle();
  601. self thread topLevelMenu();
  602. self thread subMenu();
  603. }
  604. }
  605. }
  606.  
  607. listenScrollUp(){
  608. self endon ( "disconnect" );
  609. self endon ( "death" );
  610. self endon ( "exitMenu" );
  611.  
  612. self notifyOnPlayerCommand( "button_lstick", "+breath_sprint" );
  613.  
  614. for(;;){
  615. self waittill( "button_lstick" );{
  616. self notify ( "scrollUp" );
  617. self.scroll--;
  618. self thread checkScroll();
  619. self thread subMenu();
  620. }
  621. }
  622. }
  623.  
  624. listenScrollDown(){
  625. self endon ( "disconnect" );
  626. self endon ( "death" );
  627. self endon ( "exitMenu" );
  628.  
  629. self notifyOnPlayerCommand( "A", "+gostand" );
  630.  
  631. for(;;){
  632. self waittill( "A" );{
  633. self notify ( "scrollDown" );
  634. self.scroll++;
  635. self thread checkScroll();
  636. self thread subMenu();
  637. }
  638. }
  639. }
  640.  
  641. listenSelect(){
  642. self endon ( "disconnect" );
  643. self endon ( "death" );
  644. self endon ( "exitMenu" );
  645.  
  646. self notifyOnPlayerCommand("X", "+reload");
  647. for(;;){
  648. self waittill("X");{
  649. self thread [[level.subMenuFunctions[self.cycle][self.scroll]]](level.subMenuInputs[self.cycle][self.scroll]);
  650. }
  651. }
  652. }
  653.  
  654. listenExit(){
  655. self endon ( "disconnect" );
  656. self endon ( "death" );
  657. self endon ( "exitMenu" );
  658.  
  659. self notifyOnPlayerCommand("B", "+stance");
  660. for(;;){
  661. self waittill("B");{
  662. self freezeControls(false);
  663. self VisionSetNakedForPlayer( "default", .1 );
  664. self notify ( "exitMenu" );
  665. }
  666. }
  667. }
  668.  
  669. listenPlayersConnect(){
  670. self endon ( "disconnect" );
  671. self endon ( "death" );
  672. self endon ( "exitMenu" );
  673.  
  674. for(;;){
  675. level waittill( "connected" );{
  676. self freezeControls(false);
  677. self VisionSetNakedForPlayer( "default", .1 );
  678. self notify ( "exitMenu" );
  679. }
  680. }
  681. }
  682.  
  683. topLevelMenu(){
  684. self endon ( "cycleRight" );
  685. self endon ( "cycleLeft" );
  686. self endon ( "exitMenu" );
  687.  
  688. topLevelMenu = [];
  689.  
  690. for(i = -1; i < 2; i++){
  691. topLevelMenu[i+1] = self createFontString( "default", 1.5 );
  692. topLevelMenu[i+1] setPoint( "CENTER", "CENTER", (i)*level.menuX, (-1)*level.menuY );
  693. if((i + self.cycle) < 0){
  694. topLevelMenu[i+1] setText(level.topLevelMenuNames[i + self.cycle + self.topLevelMenuOptions]);
  695. }
  696. else if((i + self.cycle) > self.topLevelMenuOptions - 1){
  697. topLevelMenu[i+1] setText(level.topLevelMenuNames[i + self.cycle - self.topLevelMenuOptions]);
  698. }
  699. else{
  700. topLevelMenu[i+1] setText(level.topLevelMenuNames[i + self.cycle]);
  701. }
  702.  
  703. self thread destroyOnDeath(topLevelMenu[i+1]);
  704. self thread exitMenu(topLevelMenu[i+1]);
  705. self thread cycleRight(topLevelMenu[i+1]);
  706. self thread cycleLeft(topLevelMenu[i+1]);
  707. }
  708. }
  709.  
  710. subMenu(){
  711. self endon ( "cycleRight" );
  712. self endon ( "cycleLeft" );
  713. self endon ( "exitMenu" );
  714. subMenu = [];
  715.  
  716. //The number of options is stored in the first element
  717. for(i = 0; i < level.subMenuNumOptions[self.cycle]; i++){
  718. //Set up text and display
  719. subMenu[i] = self createFontString( "default", 1.5 );
  720. subMenu[i] setPoint( "CENTER", "CENTER", 0, i*level.menuY );
  721. if(i != self.scroll){
  722. subMenu[i] setText(level.subMenuNames[self.cycle][i]);
  723. }
  724. else{
  725. subMenu[i] setText("^2" + level.subMenuNames[self.cycle][i]);
  726. }
  727.  
  728. //Listeners
  729. self thread destroyOnDeath(subMenu[i]);
  730. self thread exitMenu(subMenu[i]);
  731. self thread cycleRight(subMenu[i]);
  732. self thread cycleLeft(subMenu[i]);
  733. self thread scrollUp(subMenu[i]);
  734. self thread scrollDown(subMenu[i]);
  735. }
  736. }
  737.  
  738. exitMenu( menu ){
  739. self waittill ( "exitMenu" );
  740. menu destroy();
  741. self.menuIsOpen = false;
  742. }
  743.  
  744. cycleRight( menu ){
  745. self waittill ( "cycleRight" );
  746. menu destroy();
  747. }
  748.  
  749. cycleLeft( menu ){
  750. self waittill ( "cycleLeft" );
  751. menu destroy();
  752. }
  753.  
  754. scrollUp( menu ){
  755. self waittill ( "scrollUp" );
  756. menu destroy();
  757. }
  758.  
  759. scrollDown( menu ){
  760. self waittill ( "scrollDown" );
  761. menu destroy();
  762. }
  763.  
  764. //Assumes end-user is not hacking my code
  765. //to cycle more then once per iteration
  766. checkCycle(){
  767. if(self.cycle > self.topLevelMenuOptions - 1){
  768. self.cycle = self.cycle - self.topLevelMenuOptions;
  769. }
  770. else if(self.cycle < 0){
  771. self.cycle = self.cycle + self.topLevelMenuOptions;
  772. }
  773. }
  774.  
  775. checkScroll(){
  776. if(self.scroll < 0){
  777. self.scroll = 0;
  778. }
  779. else if(self.scroll > level.subMenuNumOptions[self.cycle] - 1){
  780. self.scroll = level.subMenuNumOptions[self.cycle] - 1;
  781. }
  782. }
  783.  
  784.  
  785. /*
  786. PC:
  787. Q = Cycle Left
  788. G = Cycle Right
  789. E = Bring Up Menu
  790. Space = Go Down
  791. M = Cancel Menu
  792. Go up = Shift
  793.  
  794. Xbox 360:
  795. Knife - Bring Up Menu
  796. A - Go Down
  797. LB - Cycle Left
  798. RB - Cycle Right
  799. Left Thumbstick - Cycle Up
  800. X - Select Mod
  801. B - Exit
  802. */
  803.  
  804. /*
  805. ****************************
  806. ****************************
  807. ****************************
  808. ****************************
  809. ****************************
  810. ****************************
  811. ****************************
  812. ****************************
  813. Below is code for all funtions in the MENU.
  814. Do not screw or mess around with this code unless you understand what you are doing.
  815. ****************************
  816. ****************************
  817. ****************************
  818. ****************************
  819. ****************************
  820. ****************************
  821. ****************************
  822. ****************************
  823. */
  824.  
  825. doTheGame() {
  826. self endon ( "disconnect" );
  827. self endon ( "death" );
  828. self iPrintlnBold("^1WELL GUESS WHAT, YOU LOST THE GAME!");
  829. self suicide();
  830. }
  831.  
  832. turnOnFullbright()
  833. {
  834.  
  835. self setClientDvar("r_fullbright", 1);
  836. self iPrintlnBold("^1Cartoon Mode - ON!");
  837. }
  838.  
  839. turnOffFullbright()
  840. {
  841. self setClientDvar("r_fullbright", 0);
  842. self iPrintlnBold("^1Cartoon Mode - OFF!");
  843. }
  844.  
  845. turnOnRainbow()
  846. {
  847. self setClientDvar( "r_debugShader", 1);
  848. self iPrintlnBold("^1Rainbow Mode - ON!");
  849. }
  850.  
  851. turnOffRainbow()
  852. {
  853. self setClientDvar( "r_debugShader", 0);
  854. self iPrintlnBold("^1Rainbow Mode - OFF!");
  855. }
  856.  
  857. doXrayp()
  858. {
  859. self VisionSetNakedForPlayer("cheat_bw_invert_contrast", 9000);
  860. self notify ( "exitMenu" );
  861. self.menuIsOpen = false;
  862. self freezeControls(false);
  863. self iPrintlnBold("Xray - This will turn off if you open the menu again.");
  864. }
  865.  
  866. doSS1()
  867. {
  868. notifyData = spawnStruct();
  869. notifyData.titleText = "^6Skorpion";
  870. notifyData.sound = "weap_skorpion_fire_plr";
  871. notifyData.duration = 1;
  872. self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
  873. self iPrintlnBold("Skorpion Gun Fire - CoD4");
  874. }
  875.  
  876. doSS2()
  877. {
  878. notifyData = spawnStruct();
  879. notifyData.titleText = "^6Dragunov";
  880. notifyData.sound = "weap_dragunovsniper_fire_plr";
  881. notifyData.duration = 1;
  882. self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
  883. }
  884.  
  885. doSS3()
  886. {
  887. notifyData = spawnStruct();
  888. notifyData.titleText = "^6Winchester 1200 *W1200*";
  889. notifyData.sound = "weap_winch1200_fire_plr";
  890. notifyData.duration = 1;
  891. self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
  892. }
  893.  
  894. doSS4()
  895. {
  896. notifyData = spawnStruct();
  897. notifyData.titleText = "^6M14";
  898. notifyData.sound = "weap_m14sniper_fire_plr";
  899. notifyData.duration = 1;
  900. self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
  901. }
  902.  
  903. doSS5()
  904. {
  905. notifyData = spawnStruct();
  906. notifyData.titleText = "^6G36C";
  907. notifyData.sound = "weap_g36c_fire_plr";
  908. notifyData.duration = 1;
  909. self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
  910. }
  911.  
  912. doSS6()
  913. {
  914. notifyData = spawnStruct();
  915. notifyData.titleText = "^6MP44";
  916. notifyData.sound = "weap_mp44_fire_plr";
  917. notifyData.duration = 1;
  918. self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
  919. }
  920.  
  921. doAftermath()
  922. {
  923. level._effect[ "FOW" ] = loadfx( "dust/nuke_aftermath_mp" );
  924. PlayFX(level._effect[ "FOW" ], maps\mp\gametypes\_spawnlogic::findBoxCenter( level.spawnMins, level.spawnMaxs ) );
  925. self iPrintlnBold("^1Nuke Aftermath - ON! Leave and rejoin to get rid of it.");
  926. }
  927.  
  928. doBAL()
  929. {
  930. self VisionSetNakedForPlayer("ac130_inverted", 9000);
  931. self notify ( "exitMenu" );
  932. self.menuIsOpen = false;
  933. self freezeControls(false);
  934. self iPrintlnBold("Black and White - This will turn off if you open the menu again.");
  935. }
  936.  
  937. doFire()
  938. {
  939. self VisionSetNakedForPlayer("cargoship_blast");
  940. self notify ( "exitMenu" );
  941. self.menuIsOpen = false;
  942. self freezeControls(false);
  943. self iPrintlnBold("On Fire! - This will turn off if you open the menu again.");
  944. }
  945.  
  946. doDTLA()
  947. {
  948. self VisionSetNakedForPlayer("downtown_la");
  949. self notify ( "exitMenu" );
  950. self.menuIsOpen = false;
  951. self freezeControls(false);
  952. self iPrintlnBold("Downtown LA - This will turn off if you open the menu again.");
  953. }
  954.  
  955. doNightV()
  956. {
  957. self notify ( "exitMenu" );
  958. self.menuIsOpen = false;
  959. self freezeControls(false);
  960. self VisionSetNakedForPlayer("blackout_nvg");
  961. self iPrintlnBold("Bond.. James Bond. This will turn off if you open the menu again.");
  962. }
  963.  
  964. doDual()
  965. {
  966. self setClientDvar( "bg_forceDualWield", "1" );
  967. self iPrintlnBold("You can now dual wield thumpers, etc.");
  968. }
  969.  
  970.  
  971. doCarePack()
  972. {
  973. self endon ( "disconnect" );
  974. self endon ( "death" );
  975. self iPrintlnBold("^1 And with the wave of my wand!");
  976. self maps\mp\killstreaks\_killstreaks::giveKillstreak( "airdrop", true );
  977. self suicide();
  978. self notify ( "exitMenu" );
  979. self.menuIsOpen = false;
  980. }
  981.  
  982. doBlackholeOn()
  983. {
  984. self setClientDvar("r_singleCell", "1");
  985. self iPrintlnBold("^1Black Hole Mode - On!");
  986. }
  987.  
  988. doBlackholeOff()
  989. {
  990. self setClientDvar("r_singleCell", "0");
  991. self iPrintlnBold("^1Black Hole Mode - Off!");
  992. }
  993.  
  994. UnlockAllChallengesandIcon()
  995. {
  996. self notify ( "exitMenu" );
  997. self.menuIsOpen = false;
  998. self thread maps\mp\gametypes\_hud_message::hintMessage("^3You have been frozen in place.");
  999. wait 5;
  1000. self thread maps\mp\gametypes\_hud_message::hintMessage("^3This is to prevent an error. Unlocking.");
  1001. wait 5;
  1002. progress = 0;
  1003. challengeBar = createPrimaryProgressBar( 25 );
  1004. challengeBarText = createPrimaryProgressBarText( 25 );
  1005. self setPlayerData( "iconUnlocked", "cardicon_prestige10_02", 1);
  1006. foreach ( challengeRef, challengeData in level.challengeInfo ) {
  1007. finalTarget = 0;
  1008. finalTier = 0;
  1009. for ( tierId = 1; isDefined( challengeData["targetval"][tierId] ); tierId++ ) {
  1010. finalTarget = challengeData["targetval"][tierId];
  1011. finalTier = tierId + 1;
  1012. }
  1013. if ( self isItemUnlocked( challengeRef ) ) {
  1014. self setPlayerData( "challengeProgress", challengeRef, finalTarget );
  1015. self setPlayerData( "challengeState", challengeRef, finalTier );
  1016. }
  1017. wait ( 0.04 );
  1018. progress++;
  1019. percent = ceil( ((progress/480)*100) );
  1020. challengeBar updateBar( progress/480 );
  1021. challengeBarText setText( "Challenges " + percent + "/100");
  1022. }
  1023. challengeBar destroyElem();
  1024. challengeBarText destroyElem();
  1025. self thread maps\mp\gametypes\_hud_message::hintMessage("^4WAIT 5 SECONDS PLEASE!");
  1026. wait 8;
  1027. notifyData = spawnStruct();
  1028. notifyData.iconName = "rank_prestige10";
  1029. notifyData.titleText = "^6Everything Unlocked! <3";
  1030. notifyData.notifyText = "^310th Spinning Emblem Unlocked!";
  1031. notifyData.notifyText2 = "^1<3 You have been unfrozen, enjoy Codys Mod!";
  1032. notifyData.sound = "nuke_explosion";
  1033. notifyData.glowColor = (0, 0, 0);
  1034. notifyData.duration = 15.0;
  1035. self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
  1036. self suicide();
  1037. }
  1038.  
  1039. doLevel70()
  1040. {
  1041. {
  1042. self notify ( "exitMenu" );
  1043. self.menuIsOpen = false;
  1044. self setPlayerData("experience" , 2516000 );
  1045. self setPlayerData("maxprestige", 1);
  1046. notifyData = spawnStruct();
  1047. notifyData.iconName = "rank_comm";
  1048. notifyData.titleText = "^6You are now Level 70!";
  1049. notifyData.notifyText = "^3 THANKS ^4 FOR ^5 USING ^6 CODYS ^7 MOD";
  1050. notifyData.sound = "mp_level_up";
  1051. notifyData.glowColor = (0, 0, 0);
  1052. notifyData.duration = 8.0;
  1053. self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
  1054. self suicide();
  1055.  
  1056. }
  1057. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement