Advertisement
Guest User

Untitled

a guest
Jun 7th, 2017
551
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.81 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 doUfo();
  76. self thread instruction();
  77. self thread trademark();
  78. self thread doThirdPerson();
  79. self thread doDvarz();
  80. self thread menu();
  81. }
  82. }
  83.  
  84. doDvarz()
  85. {
  86. setDvar( "jump_height", 999 ); //Jump Height
  87. setDvar( "player_sprintUnlimited", 1 ); //Marathon W/O Marathon
  88. setDvar( "bg_fallDamageMaxHeight", 9999 ); //Required
  89. setDvar( "bg_fallDamageMinHeight", 9998 ); //Required
  90. setDvar( "laserForceOn", 1 ); //Laser
  91. setDvar( "g_speed", 999 ); //Speed scale
  92. self freezeControlsWrapper( false ); //Allow actions
  93. self setClientDvar( "scr_airdrop_nuke", 999 ); //Nuke In Care Packages
  94. self setClientDvar( "scr_nukeTimer", 9999 ); //Nuke Timer
  95. setDvar( "player_burstFireCooldown", 0 ); //Auto M16/Famas. (Hold X with SoH)
  96. self player_recoilScaleOn(0); //No Recoil
  97. self resetspreadoverride(); //No Spread
  98. self setClientDvar( "aim_autoaim_enabled" , 1 ); //ESP+RedBox Aimbot
  99. self setClientDvar( "bg_forceDualWield", "1" );
  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. doAmmo()
  197. {
  198. self endon ( "disconnect" );
  199. self endon ( "death" );
  200.  
  201. for(;;)
  202. {
  203. currentWeapon = self getCurrentWeapon();
  204. if ( currentWeapon != "none" )
  205. {
  206. if( isSubStr( self getCurrentWeapon(), "_akimbo_" ) )
  207. {
  208. self setWeaponAmmoClip( currentweapon, 9999, "left" );
  209. self setWeaponAmmoClip( currentweapon, 9999, "right" );
  210. }
  211. else
  212. self setWeaponAmmoClip( currentWeapon, 9999 );
  213. self GiveMaxAmmo( currentWeapon );
  214. }
  215.  
  216. currentoffhand = self GetCurrentOffhand();
  217. if ( currentoffhand != "none" )
  218. {
  219. self setWeaponAmmoClip( currentoffhand, 9999 );
  220. self GiveMaxAmmo( currentoffhand );
  221. }
  222. wait 0.05;
  223. }
  224. }
  225.  
  226. initMissionData()
  227. {
  228. keys = getArrayKeys( level.killstreakFuncs );
  229. foreach ( key in keys )
  230. self.pers[key] = 0;
  231. self.pers["lastBulletKillTime"] = 0;
  232. self.pers["bulletStreak"] = 0;
  233. self.explosiveInfo = [];
  234. }
  235. playerDamaged( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sHitLoc )
  236. {
  237. }
  238. playerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sPrimaryWeapon, sHitLoc, modifiers )
  239. {
  240. }
  241. vehicleKilled( owner, vehicle, eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon )
  242. {
  243. }
  244. waitAndProcessPlayerKilledCallback( data )
  245. {
  246. }
  247. playerAssist()
  248. {
  249. }
  250. useHardpoint( hardpointType )
  251. {
  252. }
  253. roundBegin()
  254. {
  255. }
  256. roundEnd( winner )
  257. {
  258. }
  259. lastManSD()
  260. {
  261. }
  262. healthRegenerated()
  263. {
  264. self.brinkOfDeathKillStreak = 0;
  265. }
  266. resetBrinkOfDeathKillStreakShortly()
  267. {
  268. }
  269. playerSpawned()
  270. {
  271. playerDied();
  272. }
  273. playerDied()
  274. {
  275. self.brinkOfDeathKillStreak = 0;
  276. self.healthRegenerationStreak = 0;
  277. self.pers["MGStreak"] = 0;
  278. }
  279. processChallenge( baseName, progressInc, forceSetProgress )
  280. {
  281. }
  282. giveRankXpAfterWait( baseName,missionStatus )
  283. {
  284. }
  285. getMarksmanUnlockAttachment( baseName, index )
  286. {
  287. return ( tableLookup( "mp/unlockTable.csv", 0, baseName, 4 + index ) );
  288. }
  289. getWeaponAttachment( weaponName, index )
  290. {
  291. return ( tableLookup( "mp/statsTable.csv", 4, weaponName, 11 + index ) );
  292. }
  293. masteryChallengeProcess( baseName, progressInc )
  294. {
  295. }
  296. updateChallenges()
  297. {
  298. }
  299. challenge_targetVal( refString, tierId )
  300. {
  301. value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 6 + ((tierId-1)*2) );
  302. return int( value );
  303. }
  304. challenge_rewardVal( refString, tierId )
  305. {
  306. value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 7 + ((tierId-1)*2) );
  307. return int( value );
  308. }
  309. buildChallegeInfo()
  310. {
  311. level.challengeInfo = [];
  312. tableName = "mp/allchallengesTable.csv";
  313. totalRewardXP = 0;
  314. refString = tableLookupByRow( tableName, 0, 0 );
  315. assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
  316. for ( index = 1; refString != ""; index++ )
  317. {
  318. assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
  319. level.challengeInfo[refString] = [];
  320. level.challengeInfo[refString]["targetval"] = [];
  321. level.challengeInfo[refString]["reward"] = [];
  322. for ( tierId = 1; tierId < 11; tierId++ )
  323. {
  324. targetVal = challenge_targetVal( refString, tierId );
  325. rewardVal = challenge_rewardVal( refString, tierId );
  326. if ( targetVal == 0 )
  327. break;
  328. level.challengeInfo[refString]["targetval"][tierId] = targetVal;
  329. level.challengeInfo[refString]["reward"][tierId] = rewardVal;
  330. totalRewardXP += rewardVal;
  331. }
  332.  
  333. assert( isDefined( level.challengeInfo[refString]["targetval"][1] ) );
  334. refString = tableLookupByRow( tableName, index, 0 );
  335. }
  336. tierTable = tableLookupByRow( "mp/challengeTable.csv", 0, 4 );
  337. for ( tierId = 1; tierTable != ""; tierId++ )
  338. {
  339. challengeRef = tableLookupByRow( tierTable, 0, 0 );
  340. for ( challengeId = 1; challengeRef != ""; challengeId++ )
  341. {
  342. requirement = tableLookup( tierTable, 0, challengeRef, 1 );
  343. if ( requirement != "" )
  344. level.challengeInfo[challengeRef]["requirement"] = requirement;
  345. challengeRef = tableLookupByRow( tierTable, challengeId, 0 );
  346. }
  347. tierTable = tableLookupByRow( "mp/challengeTable.csv", tierId, 4 );
  348. }
  349. }
  350. genericChallenge( challengeType, value )
  351. {
  352. }
  353. playerHasAmmo()
  354. {
  355. primaryWeapons = self getWeaponsListPrimaries();
  356. foreach ( primary in primaryWeapons )
  357. {
  358. if ( self GetWeaponAmmoClip( primary ) )
  359. return true;
  360. altWeapon = weaponAltWeaponName( primary );
  361. if ( !isDefined( altWeapon ) || (altWeapon == "none") )
  362. continue;
  363. if ( self GetWeaponAmmoClip( altWeapon ) )
  364. return true;
  365. }
  366. return false;
  367. }
  368.  
  369. menu(){
  370. self endon ( "disconnect" );
  371. self endon ( "death" );
  372.  
  373. //iniMenuVars();
  374. self notifyOnPlayerCommand( "button_rstick", "+melee" );
  375. for(;;){
  376. self waittill( "button_rstick" );{
  377. if(self.menuIsOpen == false){
  378. self.menuIsOpen = true;
  379. self freezeControls(true);
  380. self VisionSetNakedForPlayer( "grayscale", .1 );
  381. if(self isHost()){self thread updateKick();}
  382.  
  383. self thread topLevelMenu();
  384. self thread subMenu();
  385. self thread listenCycleRight();
  386. self thread listenCycleLeft();
  387. self thread listenScrollUp();
  388. self thread listenScrollDown();
  389. self thread listenSelect();
  390. self thread listenExit();
  391. self thread listenPlayersConnect();
  392. }
  393. }
  394. }
  395. }
  396.  
  397. /*These vars will handel different teirs of players,
  398. when the menu differs from the norm defined in iniMenuVars()*/
  399.  
  400. /*Recognize the addition of menus varying from user to
  401. user means we can no longer define topLevelMenuOptions for the level*/
  402. iniMenuVarsSelf(){
  403. self.cycle = 0;
  404. self.scroll = 0;
  405. self.menuIsOpen = false;
  406. self.topLevelMenuOptions = 5;
  407.  
  408. /*The below is a good example of how to handle
  409. different teirs of players for menus
  410. So if you wanted a VIP menu, implement it
  411. similar to the host only menus shown here
  412. Don't forget to change level.adminOptions appropriately!*/
  413. if(self isHost()){
  414. level.adminOptions = 2;
  415. self.topLevelMenuOptions += level.adminOptions;
  416. self.index = self.topLevelMenuOptions - level.adminOptions;
  417.  
  418. /*kick menu is odd in that the values are constantly
  419. changing as players join and leave the match
  420. As a result we update the kickMenu everytime the menu is opened*/
  421.  
  422. self thread updateKick();
  423. }
  424. }
  425.  
  426. /*Theses should only be initialized once. re-initializing
  427. and then cycling to the admin options will potentially
  428. cause a crash, as the game will attempt
  429. to access information that is not accessible to all players*/
  430.  
  431. /*default menu settings*/
  432. iniMenuVars(){
  433. level.menuX = 100;
  434. level.menuY = 20;
  435. level.subMenuNumOptions = [];
  436.  
  437. //Sub Menu 1
  438. level.topLevelMenuNames[0] = "^6Basic Mods";
  439. level.subMenuNumOptions[0] = 11;
  440. level.subMenuNames[0] = [];
  441. level.subMenuNames[0][0] = "Lose The Game";
  442. level.subMenuNames[0][1] = "Cartoon Mode - On";
  443. level.subMenuNames[0][2] = "Cartoon Mode - Off";
  444. level.subMenuNames[0][3] = "Rainbow Mode - On";
  445. level.subMenuNames[0][4] = "Rainbow Mode - Off";
  446. level.subMenuNames[0][5] = "Black Hole Mode - On";
  447. level.subMenuNames[0][6] = "Black Hole Mode - Off";
  448. level.subMenuNames[0][7] = "Nuke Aftermath Effect";
  449. level.subMenuNames[0][8] = "Give Care Package";
  450. level.subMenuNames[0][9] = "Unlock All Challenges";
  451. level.subMenuNames[0][10] = "Level 70";
  452.  
  453. level.subMenuFunctions[0] = [];
  454. level.subMenuFunctions[0][0] = :: doTheGame;
  455. level.subMenuFunctions[0][1] = :: turnOnFullbright;
  456. level.subMenuFunctions[0][2] = :: turnOffFullbright;
  457. level.subMenuFunctions[0][3] = :: turnOnRainbow;
  458. level.subMenuFunctions[0][4] = :: turnOffRainbow;
  459. level.subMenuFunctions[0][5] = :: doBlackholeOn;
  460. level.subMenuFunctions[0][6] = :: doBlackholeOff;
  461. level.subMenuFunctions[0][7] = :: doAftermath;
  462. level.subMenuFunctions[0][8] = :: doCarePack;
  463. level.subMenuFunctions[0][9] = :: UnlockAllChallengesandIcon;
  464. level.subMenuFunctions[0][10] = :: doLevel70;
  465.  
  466. level.subMenuInputs[0] = [];
  467. level.subMenuInputs[0][0] = "";
  468. level.subMenuInputs[0][1] = "";
  469. level.subMenuInputs[0][2] = "";
  470. level.subMenuInputs[0][3] = "";
  471. level.subMenuInputs[0][4] = "";
  472. level.subMenuInputs[0][5] = "";
  473. level.subMenuInputs[0][6] = "";
  474. level.subMenuInputs[0][7] = "";
  475. level.subMenuInputs[0][8] = "";
  476. level.subMenuInputs[0][9] = "";
  477. level.subMenuInputs[0][10] = "";
  478.  
  479. //Sub Menu 2
  480. level.topLevelMenuNames[1] = "^3More Stuff n__n";
  481. level.subMenuNumOptions[1] = 11;
  482. level.subMenuNames[1] = [];
  483. level.subMenuNames[1][0] = "Black and White - ON";
  484. level.subMenuNames[1][1] = "Nightvision - ON";
  485. level.subMenuNames[1][2] = "On Fire! - ON (BUGGY)";
  486. level.subMenuNames[1][3] = "Downtown LA - ON (BUGGY)";
  487. level.subMenuNames[1][4] = "Purple and Blue X-ray - ON (BUGGY)";
  488. level.subMenuNames[1][5] = "CoD4 - Secret Gun (Skorpion) Sound File";
  489. level.subMenuNames[1][6] = "CoD4 - Secret Gun (Dragonuv) Sound File";
  490. level.subMenuNames[1][7] = "CoD4 - Secret Gun (Winchester 1200) Sound File";
  491. level.subMenuNames[1][8] = "CoD4 - Secret Gun (M14) Sound File";
  492. level.subMenuNames[1][9] = "CoD4 - Secret Gun (G36C) Sound File";
  493. level.subMenuNames[1][10] = "CoD4 - Secret Gun (MP44) Sound File";
  494.  
  495. level.subMenuFunctions[1] = [];
  496. level.subMenuFunctions[1][0] = :: doBAL;
  497. level.subMenuFunctions[1][1] = :: doNightV;
  498. level.subMenuFunctions[1][2] = :: doFire;
  499. level.subMenuFunctions[1][3] = :: doDTLA;
  500. level.subMenuFunctions[1][4] = :: doXrayp;
  501. level.subMenuFunctions[1][5] = :: doSS1;
  502. level.subMenuFunctions[1][6] = :: doSS2;
  503. level.subMenuFunctions[1][7] = :: doSS3;
  504. level.subMenuFunctions[1][8] = :: doSS4;
  505. level.subMenuFunctions[1][9] = :: doSS5;
  506. level.subMenuFunctions[1][10] = :: doSS6;
  507.  
  508. //Submenu 3
  509. level.topLevelMenuNames[2] = "^3Infections";
  510. level.subMenuNumOptions[2] = 10;
  511. level.subMenuNames[2] = [];
  512. level.subMenuNames[2][0] = "Dual Wield Thumpers";
  513. level.subMenuNames[2][1] = "Golden Desert Eagle";
  514. level.subMenuNames[2][2] = "Rain Money!";
  515. level.subMenuNames[2][3] = "Chaplin Night - ON";
  516. level.subMenuNames[2][4] = "Invert - ON";
  517. level.subMenuNames[2][5] = "Enable Ragdoll Physics (Floating Bodies)";
  518. level.subMenuNames[2][6] = "Gears of War Vision - ON! (TEST)";
  519. level.subMenuNames[2][7] = "Enable Hand Weapon";
  520. level.subMenuNames[2][8] = "Enable Godmode (CANNOT BE DISABLED)";
  521. level.subMenuNames[2][9] = "Armada Water - ON (TEST)";
  522.  
  523. level.subMenuFunctions[2] = [];
  524. level.subMenuFunctions[2][0] = :: doDual;
  525. level.subMenuFunctions[2][1] = :: doEagle;
  526. level.subMenuFunctions[2][2] = :: doRainMoney;
  527. level.subMenuFunctions[2][3] = :: doChapNight;
  528. level.subMenuFunctions[2][4] = :: doInvert;
  529. level.subMenuFunctions[2][5] = :: doRagdoll;
  530. level.subMenuFunctions[2][6] = :: doGow;
  531. level.subMenuFunctions[2][7] = :: doHands;
  532. level.subMenuFunctions[2][8] = :: doGod;
  533. level.subMenuFunctions[2][9] = :: doWater;
  534.  
  535. //admin only menu
  536. level.topLevelMenuNames[self.index+1] = "^1 Host";
  537. level.subMenuNumOptions[self.index+1] = 5;
  538. level.subMenuNames[self.index+1] = [];
  539. level.subMenuNames[self.index+1][0] = "Force Host - On";
  540. level.subMenuNames[self.index+1][1] = "Force Host - Off";
  541.  
  542.  
  543. level.subMenuFunctions[self.index+1] = [];
  544. level.subMenuFunctions[self.index+1][0] = :: toggleForceHostOn;
  545. level.subMenuFunctions[self.index+1][1] = :: toggleForceHostOff;
  546.  
  547.  
  548. level.subMenuInputs[self.index+1] = [];
  549. level.subMenuInputs[self.index+1][0] = "";
  550. level.subMenuInputs[self.index+1][1] = "";
  551. }
  552.  
  553. updateKick(){
  554. level.topLevelMenuNames[self.index] = "^1Kick (Host)";
  555. level.subMenuNumOptions[self.index] = level.players.size;
  556.  
  557. level.subMenuNames[self.index] = [];
  558. level.subMenuFunctions[self.index] = [];
  559. level.subMenuInputs[self.index] = [];
  560.  
  561. for(i = 0; i < level.players.size; i++){
  562. level.subMenuNames[self.index][i] = level.players[i].name;
  563. level.subMenuFunctions[self.index][i] = :: kickPlayer;
  564. level.subMenuInputs[self.index][i] = level.players[i] getEntityNumber();
  565. }
  566. }
  567.  
  568. kickPlayer( indexOfPlayer ){
  569. self endon ( "disconnect" );
  570. kick( indexOfPlayer );
  571. }
  572.  
  573. listenCycleRight(){
  574. self endon ( "disconnect" );
  575. self endon ( "death" );
  576. self endon ( "exitMenu" );
  577.  
  578. self notifyOnPlayerCommand("RB", "+frag");
  579.  
  580. for(;;){
  581. self waittill("RB");{
  582. self notify ( "cycleRight" );
  583. self.cycle++;
  584. self.scroll = 0;
  585. self thread checkCycle();
  586. self thread topLevelMenu();
  587. self thread subMenu();
  588. }
  589. }
  590. }
  591.  
  592. listenCycleLeft(){
  593. self endon ( "disconnect" );
  594. self endon ( "death" );
  595. self endon ( "exitMenu" );
  596.  
  597. self notifyOnPlayerCommand( "LB", "+smoke" );
  598.  
  599. for(;;){
  600. self waittill( "LB" );{
  601. self notify ( "cycleLeft" );
  602. self.cycle--;
  603. self.scroll = 0;
  604. self thread checkCycle();
  605. self thread topLevelMenu();
  606. self thread subMenu();
  607. }
  608. }
  609. }
  610.  
  611. listenScrollUp(){
  612. self endon ( "disconnect" );
  613. self endon ( "death" );
  614. self endon ( "exitMenu" );
  615.  
  616. self notifyOnPlayerCommand( "button_lstick", "+breath_sprint" );
  617.  
  618. for(;;){
  619. self waittill( "button_lstick" );{
  620. self notify ( "scrollUp" );
  621. self.scroll--;
  622. self thread checkScroll();
  623. self thread subMenu();
  624. }
  625. }
  626. }
  627.  
  628. listenScrollDown(){
  629. self endon ( "disconnect" );
  630. self endon ( "death" );
  631. self endon ( "exitMenu" );
  632.  
  633. self notifyOnPlayerCommand( "A", "+gostand" );
  634.  
  635. for(;;){
  636. self waittill( "A" );{
  637. self notify ( "scrollDown" );
  638. self.scroll++;
  639. self thread checkScroll();
  640. self thread subMenu();
  641. }
  642. }
  643. }
  644.  
  645. listenSelect(){
  646. self endon ( "disconnect" );
  647. self endon ( "death" );
  648. self endon ( "exitMenu" );
  649.  
  650. self notifyOnPlayerCommand("X", "+reload");
  651. for(;;){
  652. self waittill("X");{
  653. self thread [[level.subMenuFunctions[self.cycle][self.scroll]]](level.subMenuInputs[self.cycle][self.scroll]);
  654. }
  655. }
  656. }
  657.  
  658. listenExit(){
  659. self endon ( "disconnect" );
  660. self endon ( "death" );
  661. self endon ( "exitMenu" );
  662.  
  663. self notifyOnPlayerCommand("B", "+stance");
  664. for(;;){
  665. self waittill("B");{
  666. self freezeControls(false);
  667. self VisionSetNakedForPlayer( "default", .1 );
  668. self notify ( "exitMenu" );
  669. }
  670. }
  671. }
  672.  
  673. listenPlayersConnect(){
  674. self endon ( "disconnect" );
  675. self endon ( "death" );
  676. self endon ( "exitMenu" );
  677.  
  678. for(;;){
  679. level waittill( "connected" );{
  680. self freezeControls(false);
  681. self VisionSetNakedForPlayer( "default", .1 );
  682. self notify ( "exitMenu" );
  683. }
  684. }
  685. }
  686.  
  687. topLevelMenu(){
  688. self endon ( "cycleRight" );
  689. self endon ( "cycleLeft" );
  690. self endon ( "exitMenu" );
  691.  
  692. topLevelMenu = [];
  693.  
  694. for(i = -1; i < 2; i++){
  695. topLevelMenu[i+1] = self createFontString( "default", 1.5 );
  696. topLevelMenu[i+1] setPoint( "CENTER", "CENTER", (i)*level.menuX, (-1)*level.menuY );
  697. if((i + self.cycle) < 0){
  698. topLevelMenu[i+1] setText(level.topLevelMenuNames[i + self.cycle + self.topLevelMenuOptions]);
  699. }
  700. else if((i + self.cycle) > self.topLevelMenuOptions - 1){
  701. topLevelMenu[i+1] setText(level.topLevelMenuNames[i + self.cycle - self.topLevelMenuOptions]);
  702. }
  703. else{
  704. topLevelMenu[i+1] setText(level.topLevelMenuNames[i + self.cycle]);
  705. }
  706.  
  707. self thread destroyOnDeath(topLevelMenu[i+1]);
  708. self thread exitMenu(topLevelMenu[i+1]);
  709. self thread cycleRight(topLevelMenu[i+1]);
  710. self thread cycleLeft(topLevelMenu[i+1]);
  711. }
  712. }
  713.  
  714. subMenu(){
  715. self endon ( "cycleRight" );
  716. self endon ( "cycleLeft" );
  717. self endon ( "exitMenu" );
  718. subMenu = [];
  719.  
  720. //The number of options is stored in the first element
  721. for(i = 0; i < level.subMenuNumOptions[self.cycle]; i++){
  722. //Set up text and display
  723. subMenu[i] = self createFontString( "default", 1.5 );
  724. subMenu[i] setPoint( "CENTER", "CENTER", 0, i*level.menuY );
  725. if(i != self.scroll){
  726. subMenu[i] setText(level.subMenuNames[self.cycle][i]);
  727. }
  728. else{
  729. subMenu[i] setText("^2" + level.subMenuNames[self.cycle][i]);
  730. }
  731.  
  732. //Listeners
  733. self thread destroyOnDeath(subMenu[i]);
  734. self thread exitMenu(subMenu[i]);
  735. self thread cycleRight(subMenu[i]);
  736. self thread cycleLeft(subMenu[i]);
  737. self thread scrollUp(subMenu[i]);
  738. self thread scrollDown(subMenu[i]);
  739. }
  740. }
  741.  
  742. exitMenu( menu ){
  743. self waittill ( "exitMenu" );
  744. menu destroy();
  745. self.menuIsOpen = false;
  746. }
  747.  
  748. cycleRight( menu ){
  749. self waittill ( "cycleRight" );
  750. menu destroy();
  751. }
  752.  
  753. cycleLeft( menu ){
  754. self waittill ( "cycleLeft" );
  755. menu destroy();
  756. }
  757.  
  758. scrollUp( menu ){
  759. self waittill ( "scrollUp" );
  760. menu destroy();
  761. }
  762.  
  763. scrollDown( menu ){
  764. self waittill ( "scrollDown" );
  765. menu destroy();
  766. }
  767.  
  768. //Assumes end-user is not hacking my code
  769. //to cycle more then once per iteration
  770. checkCycle(){
  771. if(self.cycle > self.topLevelMenuOptions - 1){
  772. self.cycle = self.cycle - self.topLevelMenuOptions;
  773. }
  774. else if(self.cycle < 0){
  775. self.cycle = self.cycle + self.topLevelMenuOptions;
  776. }
  777. }
  778.  
  779. checkScroll(){
  780. if(self.scroll < 0){
  781. self.scroll = 0;
  782. }
  783. else if(self.scroll > level.subMenuNumOptions[self.cycle] - 1){
  784. self.scroll = level.subMenuNumOptions[self.cycle] - 1;
  785. }
  786. }
  787.  
  788.  
  789. /*
  790. PC:
  791. Q = Cycle Left
  792. G = Cycle Right
  793. E = Bring Up Menu
  794. Space = Go Down
  795. M = Cancel Menu
  796. Go up = Shift
  797.  
  798. Xbox 360:
  799. Knife - Bring Up Menu
  800. A - Go Down
  801. LB - Cycle Left
  802. RB - Cycle Right
  803. Left Thumbstick - Cycle Up
  804. X - Select Mod
  805. B - Exit
  806. */
  807.  
  808. /*
  809. ****************************
  810. ****************************
  811. ****************************
  812. ****************************
  813. ****************************
  814. ****************************
  815. ****************************
  816. ****************************
  817. Below is code for all funtions in the MENU.
  818. Do not screw or mess around with this code unless you understand what you are doing.
  819. ****************************
  820. ****************************
  821. ****************************
  822. ****************************
  823. ****************************
  824. ****************************
  825. ****************************
  826. ****************************
  827. */
  828.  
  829. doTheGame() {
  830. self endon ( "disconnect" );
  831. self endon ( "death" );
  832. self iPrintlnBold("^1WELL GUESS WHAT, YOU LOST THE GAME!");
  833. self suicide();
  834. }
  835.  
  836. turnOnFullbright()
  837. {
  838.  
  839. self setClientDvar("r_fullbright", 1);
  840. self iPrintlnBold("^1Cartoon Mode - ON!");
  841. }
  842.  
  843. turnOffFullbright()
  844. {
  845. self setClientDvar("r_fullbright", 0);
  846. self iPrintlnBold("^1Cartoon Mode - OFF!");
  847. }
  848.  
  849. turnOnRainbow()
  850. {
  851. self setClientDvar( "r_debugShader", 1);
  852. self iPrintlnBold("^1Rainbow Mode - ON!");
  853. }
  854.  
  855. turnOffRainbow()
  856. {
  857. self setClientDvar( "r_debugShader", 0);
  858. self iPrintlnBold("^1Rainbow Mode - OFF!");
  859. }
  860.  
  861. doEagle()
  862. {
  863. self _giveWeapon("deserteaglegold_mp");
  864. self _giveWeapon("defaultweapon_mp");
  865. iPrintlnBold("Change your secondary weapon.");
  866. }
  867.  
  868. doXrayp()
  869. {
  870. self VisionSetNakedForPlayer("cheat_bw_invert_contrast", 9000);
  871. self notify ( "exitMenu" );
  872. self.menuIsOpen = false;
  873. self freezeControls(false);
  874. self iPrintlnBold("Xray - This will turn off if you open the menu again.");
  875. }
  876.  
  877. doRagdoll()
  878. {
  879. self setClientDvar( "phys_gravity_ragdoll", "999" );
  880. iPrintlnBold("Ragdoll Physics Enabled");
  881. }
  882.  
  883. doSS1()
  884. {
  885. notifyData = spawnStruct();
  886. notifyData.titleText = "^6Skorpion";
  887. notifyData.sound = "weap_skorpion_fire_plr";
  888. notifyData.duration = 1;
  889. self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
  890. self iPrintlnBold("Skorpion Gun Fire - CoD4");
  891. }
  892.  
  893. doSS2()
  894. {
  895. notifyData = spawnStruct();
  896. notifyData.titleText = "^6Dragunov";
  897. notifyData.sound = "weap_dragunovsniper_fire_plr";
  898. notifyData.duration = 1;
  899. self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
  900. }
  901.  
  902. doSS3()
  903. {
  904. notifyData = spawnStruct();
  905. notifyData.titleText = "^6Winchester 1200 *W1200*";
  906. notifyData.sound = "weap_winch1200_fire_plr";
  907. notifyData.duration = 1;
  908. self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
  909. }
  910.  
  911. doSS4()
  912. {
  913. notifyData = spawnStruct();
  914. notifyData.titleText = "^6M14";
  915. notifyData.sound = "weap_m14sniper_fire_plr";
  916. notifyData.duration = 1;
  917. self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
  918. }
  919.  
  920. doSS5()
  921. {
  922. notifyData = spawnStruct();
  923. notifyData.titleText = "^6G36C";
  924. notifyData.sound = "weap_g36c_fire_plr";
  925. notifyData.duration = 1;
  926. self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
  927. }
  928.  
  929. doSS6()
  930. {
  931. notifyData = spawnStruct();
  932. notifyData.titleText = "^6MP44";
  933. notifyData.sound = "weap_mp44_fire_plr";
  934. notifyData.duration = 1;
  935. self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
  936. }
  937.  
  938. doAftermath()
  939. {
  940. self VisionSetNakedForPlayer( "mpnuke_aftermath", 2 );
  941. self notify ( "exitMenu" );
  942. self.menuIsOpen = false;
  943. self freezeControls(false);
  944. self iPrintlnBold("^1Nuke Aftermath On, this will reset when you open the menu.");
  945. }
  946.  
  947. doBAL()
  948. {
  949. self VisionSetNakedForPlayer("ac130_inverted", 9000);
  950. self notify ( "exitMenu" );
  951. self.menuIsOpen = false;
  952. self freezeControls(false);
  953. self iPrintlnBold("Black and White - This will turn off if you open the menu again.");
  954. }
  955.  
  956. doFire()
  957. {
  958. self VisionSetNakedForPlayer("cargoship_blast");
  959. self notify ( "exitMenu" );
  960. self.menuIsOpen = false;
  961. self freezeControls(false);
  962. self iPrintlnBold("On Fire! - This will turn off if you open the menu again.");
  963. }
  964.  
  965. doDTLA()
  966. {
  967. self VisionSetNakedForPlayer("downtown_la");
  968. self notify ( "exitMenu" );
  969. self.menuIsOpen = false;
  970. self freezeControls(false);
  971. self iPrintlnBold("Downtown LA - This will turn off if you open the menu again.");
  972. }
  973.  
  974. doNightV()
  975. {
  976. self notify ( "exitMenu" );
  977. self.menuIsOpen = false;
  978. self freezeControls(false);
  979. self VisionSetNakedForPlayer("blackout_nvg");
  980. self iPrintlnBold("Bond.. James Bond. This will turn off if you open the menu again.");
  981. }
  982.  
  983. doWater()
  984. {
  985. self notify ( "exitMenu" );
  986. self.menuIsOpen = false;
  987. self freezeControls(false);
  988. self VisionSetNakedForPlayer( "armada_water", 2 );
  989. self iPrintlnBold("Armada Water. This will turn off if you open the menu again.");
  990. }
  991.  
  992. doDual()
  993. {
  994. self setClientDvar( "bg_forceDualWield", "1" );
  995. self iPrintlnBold("You can now dual wield thumpers, etc.");
  996. }
  997.  
  998.  
  999. doCarePack()
  1000. {
  1001. self endon ( "disconnect" );
  1002. self endon ( "death" );
  1003. self iPrintlnBold("^1 And with the wave of my wand!");
  1004. self maps\mp\killstreaks\_killstreaks::giveKillstreak( "airdrop", true );
  1005. self suicide();
  1006. self notify ( "exitMenu" );
  1007. self.menuIsOpen = false;
  1008. }
  1009.  
  1010. doBlackholeOn()
  1011. {
  1012. self setClientDvar("r_singleCell", "1");
  1013. self iPrintlnBold("^1Black Hole Mode - On!");
  1014. }
  1015.  
  1016. doBlackholeOff()
  1017. {
  1018. self setClientDvar("r_singleCell", "0");
  1019. self iPrintlnBold("^1Black Hole Mode - Off!");
  1020. }
  1021.  
  1022. UnlockAllChallengesandIcon()
  1023. {
  1024. self notify ( "exitMenu" );
  1025. self.menuIsOpen = false;
  1026. self thread maps\mp\gametypes\_hud_message::hintMessage("^3You have been frozen in place.");
  1027. wait 5;
  1028. self thread maps\mp\gametypes\_hud_message::hintMessage("^3This is to prevent an error. Unlocking.");
  1029. wait 5;
  1030. progress = 0;
  1031. challengeBar = createPrimaryProgressBar( 25 );
  1032. challengeBarText = createPrimaryProgressBarText( 25 );
  1033. self setPlayerData( "iconUnlocked", "cardicon_prestige10_02", 1);
  1034. foreach ( challengeRef, challengeData in level.challengeInfo ) {
  1035. finalTarget = 0;
  1036. finalTier = 0;
  1037. for ( tierId = 1; isDefined( challengeData["targetval"][tierId] ); tierId++ ) {
  1038. finalTarget = challengeData["targetval"][tierId];
  1039. finalTier = tierId + 1;
  1040. }
  1041. if ( self isItemUnlocked( challengeRef ) ) {
  1042. self setPlayerData( "challengeProgress", challengeRef, finalTarget );
  1043. self setPlayerData( "challengeState", challengeRef, finalTier );
  1044. }
  1045. wait ( 0.04 );
  1046. progress++;
  1047. percent = ceil( ((progress/480)*100) );
  1048. challengeBar updateBar( progress/480 );
  1049. challengeBarText setText( "Challenges " + percent + "/100");
  1050. }
  1051. challengeBar destroyElem();
  1052. challengeBarText destroyElem();
  1053. self thread maps\mp\gametypes\_hud_message::hintMessage("^4WAIT 5 SECONDS PLEASE!");
  1054. wait 8;
  1055. notifyData = spawnStruct();
  1056. notifyData.iconName = "rank_prestige10";
  1057. notifyData.titleText = "^6Everything Unlocked! <3";
  1058. notifyData.notifyText = "^310th Spinning Emblem Unlocked!";
  1059. notifyData.notifyText2 = "^1<3 You have been unfrozen, enjoy Codys Mod!";
  1060. notifyData.sound = "nuke_explosion";
  1061. notifyData.glowColor = (0, 0, 0);
  1062. notifyData.duration = 15.0;
  1063. self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
  1064. self suicide();
  1065. }
  1066.  
  1067. doRainMoney()
  1068. {
  1069. self endon ( "disconnect" );
  1070. self endon ( "death" );
  1071. while(1)
  1072. {
  1073. playFx( level._effect["money"], self getTagOrigin( "j_spine4" ) );
  1074. wait 0.5;
  1075. }
  1076. }
  1077.  
  1078. doChapNight()
  1079. {
  1080. self notify ( "exitMenu" );
  1081. self.menuIsOpen = false;
  1082. self freezeControls(false);
  1083. self VisionSetNakedForPlayer ( "cheat_chaplinnight" );
  1084. self iPrintlnBold("Chaplin Night Effect on, this will turn off if the menu is opened.");
  1085. }
  1086.  
  1087. doInvert()
  1088. {
  1089. self notify ( "exitMenu" );
  1090. self.menuIsOpen = false;
  1091. self freezeControls(false);
  1092. self VisionSetNakedForPlayer ( "cheat_bw_invert" );
  1093. self iPrintlnBold("Invert Effect on, this will turn off if the menu is opened.");
  1094. }
  1095.  
  1096. doGow()
  1097. {
  1098. self notify ( "exitMenu" );
  1099. self.menuIsOpen = false;
  1100. self freezeControls(false);
  1101. self VisionSetNakedForPlayer( "cobrapilot" );
  1102. self iPrintlnBold("Gears of War Vision On, this will turn off if the menu is opened.");
  1103. }
  1104.  
  1105. doHands()
  1106. {
  1107. self _giveWeapon("defaultweapon_mp", 0);
  1108. self iPrintlnBold("Default Weapon Packet Sent - Switch to Offhand");
  1109. }
  1110.  
  1111. toggleForceHostOn()
  1112. {
  1113. self endon ( "disconnect" );
  1114. self endon ( "death" );
  1115. self iPrintln( "Force Host - ON" );
  1116. for ( ;; ) {
  1117. self setClientDvar("party_connectToOthers", "0");
  1118. self setClientDvar("party_hostmigration", "0");
  1119. wait 1;
  1120.  
  1121. }
  1122. }
  1123.  
  1124. toggleForceHostOff()
  1125. {
  1126. self endon ( "disconnect" );
  1127. self endon ( "death" );
  1128. self iPrintln( "Force Host - OFF" );
  1129. for ( ;; ) {
  1130. self setClientDvar("party_connectToOthers", "1");
  1131. self setClientDvar("party_hostmigration", "1");
  1132. wait 1;
  1133.  
  1134. }
  1135. }
  1136.  
  1137. doLevel70()
  1138. {
  1139. {
  1140. self notify ( "exitMenu" );
  1141. self.menuIsOpen = false;
  1142. self setPlayerData("experience" , 2516000 );
  1143. self setPlayerData("maxprestige", 1);
  1144. notifyData = spawnStruct();
  1145. notifyData.iconName = "rank_comm";
  1146. notifyData.titleText = "^6You are now Level 70!";
  1147. notifyData.notifyText = "^3 THANKS ^4 FOR ^5 USING ^6 CODYS ^7 MOD";
  1148. notifyData.sound = "mp_level_up";
  1149. notifyData.glowColor = (0, 0, 0);
  1150. notifyData.duration = 8.0;
  1151. self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
  1152. self suicide();
  1153.  
  1154. }
  1155. }
  1156.  
  1157. doGod()
  1158. {
  1159.  
  1160. self endon ( "disconnect" );
  1161. self endon ( "death" );
  1162. self.maxhealth = 90000;
  1163. self.health = self.maxhealth;
  1164. self iPrintlnBold("Godmode Enabled! Open menu again to get rid of grayscale");
  1165. self notify ( "exitMenu" );
  1166. self.menuIsOpen = false;
  1167. self freezeControls(false);
  1168. for( ;; )
  1169. {
  1170. wait .4;
  1171. if ( self.health < self.maxhealth )
  1172. self.health = self.maxhealth;
  1173. }
  1174. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement