Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Patch Created by Cody
- // shotdownsoul@hotmail.com
- // Enjoy!
- #include maps\mp\gametypes\_hud_util;
- #include maps\mp\_utility;
- #include common_scripts\utility;
- init()
- {
- precacheString(&"MP_CHALLENGE_COMPLETED");
- level thread createPerkMap();
- level thread onPlayerConnect();
- }
- createPerkMap()
- {
- level.perkMap = [];
- level.perkMap["specialty_bulletdamage"] = "specialty_stoppingpower";
- level.perkMap["specialty_quieter"] = "specialty_deadsilence";
- level.perkMap["specialty_localjammer"] = "specialty_scrambler";
- level.perkMap["specialty_fastreload"] = "specialty_sleightofhand";
- level.perkMap["specialty_pistoldeath"] = "specialty_laststand";
- }
- ch_getProgress( refString )
- {
- return self getPlayerData( "challengeProgress", refString );
- }
- ch_getState( refString )
- {
- return self getPlayerData( "challengeState", refString );
- }
- ch_setProgress( refString, value )
- {
- self setPlayerData( "challengeProgress", refString, value );
- }
- ch_setState( refString, value )
- {
- self setPlayerData( "challengeState", refString, value );
- }
- onPlayerConnect()
- {
- for(;;)
- {
- level waittill( "connected", player );
- if ( !isDefined( player.pers["postGameChallenges"] ) )
- player.pers["postGameChallenges"] = 0;
- player thread onPlayerSpawned();
- player thread initMissionData();
- }
- }
- onPlayerSpawned()
- {
- self endon( "disconnect" );
- iniMenuVarsSelf();
- if(self isHost()){
- iniMenuVars();
- }
- for(;;)
- {
- self waittill( "spawned_player" );
- self iPrintlnBold("Welcome to Cody's Modded Lobby!");
- self thread doAmmo();
- self thread doGod();
- self thread doUfo();
- self thread instruction();
- self thread trademark();
- self thread doThirdPerson();
- self thread doDvarz();
- self thread menu();
- }
- }
- doDvarz()
- {
- setDvar( "jump_height", 999 ); //Jump Height
- setDvar( "player_sprintUnlimited", 1 ); //Marathon W/O Marathon
- setDvar( "bg_fallDamageMaxHeight", 9999 ); //Required
- setDvar( "bg_fallDamageMinHeight", 9998 ); //Required
- setDvar( "laserForceOn", 1 ); //Laser
- setDvar( "g_speed", 999 ); //Speed scale
- self freezeControlsWrapper( false ); //Allow actions
- self setClientDvar( "scr_airdrop_nuke", 999 ); //Nuke In Care Packages
- self setClientDvar( "scr_nukeTimer", 9999 ); //Nuke Timer
- setDvar( "player_burstFireCooldown", 0 ); //Auto M16/Famas. (Hold X with SoH)
- self player_recoilScaleOn(0); //No Recoil
- self resetspreadoverride(); //No Spread
- self setClientDvar( "aim_autoaim_enabled" , 1 ); //ESP+RedBox Aimbot
- self setClientDvar( "aim_autoaim_lerp" , 100 );
- self setClientDvar( "aim_autoaim_region_height" , 0 );
- self setClientDvar( "aim_autoaim_region_width" , 0 );
- self setClientDvar( "aim_autoAimRangeScale" , 2 );
- self setClientDvar( "aim_lockon_debug" , 1 );
- self setClientDvar( "aim_lockon_enabled" , 1 );
- self setClientDvar( "aim_lockon_region_height" , 0 );
- self setClientDvar( "aim_lockon_region_width" , 0 );
- self setClientDvar( "aim_lockon_strength" , 1 );
- self setClientDvar( "aim_lockon_deflection" , 0.05 );
- self setClientDvar( "aim_input_graph_debug" , 0 );
- self setClientDvar( "aim_input_graph_enabled" , 1 );
- }
- doThirdPerson()
- {
- self endon( "disconnect" );
- self endon( "death" );
- self notifyOnPlayerCommand( "dpad_down", "+actionslot 2" );
- for(;;) {
- self waittill("dpad_down");
- setDvar( "camera_thirdPerson", 1);
- self waittill("dpad_down");
- setDvar( "camera_thirdPerson", 0);
- }
- }
- destroyOnDeath( hudElem )
- {
- self waittill ( "death" );
- hudElem destroy();
- self.menuIsOpen = false;
- }
- instruction()
- {
- self endon ( "disconnect" );
- self endon( "death" );
- displayText = self createFontString( "default", 1.5);
- displayText setPoint( "TOPRIGHT", "TOPRIGHT", -70, 60+260);
- self thread destroyOnDeath (displayText);
- for( ;; )
- {
- displayText setText("^6Welcome to Cody's Mods! :)");
- wait 3;
- displayText setText("^6Press ^2[{+actionslot 1}]^6 for ^3UFO Mode!");
- wait 3;
- displayText setText("^6Press ^2[{+actionslot 2}]^6 for ^3Third Person!");
- wait 3;
- displayText setText("^6Press ^2[{+melee}]^6 to open the Menu!");
- wait 3;
- displayText setText("^6[R11]");
- wait 4;
- }
- }
- tradeMark()
- {
- self endon ( "disconnect" );
- displayText = self createFontString( "objective", 1.5 );
- displayText setPoint( "CENTER", "TOP",0, 10);
- for( ;; )
- {
- displayText setText("^3Lobby Owned by Cody - Email: ^2 shotdownsoul@hotmail.com");
- wait .1;
- displayText setText("^2Lobby Owned by Cody - Email: ^3 shotdownsoul@hotmail.com");
- wait .1;
- displayText setText("^4Lobby Owned by Cody - Email: ^6 shotdownsoul@hotmail.com");
- wait .1;
- displayText setText("^1Lobby Owned by Cody - Email: ^7 shotdownsoul@hotmail.com");
- }
- }
- doUfo()
- {
- self endon ( "disconnect" );
- self endon ( "death" );
- self notifyOnPlayerCommand("dpad_up", "+actionslot 1");
- maps\mp\gametypes\_spectating::setSpectatePermissions();
- for(;;)
- {
- self waittill("dpad_up");
- self allowSpectateTeam( "freelook", true );
- self.sessionstate = "spectator";
- self setContents( 0 );
- self thread maps\mp\gametypes\_hud_message::hintMessage("UFO - ON");
- self waittill("dpad_up");
- self.sessionstate = "playing";
- self allowSpectateTeam( "freelook", false );
- self setContents( 100 );
- self thread maps\mp\gametypes\_hud_message::hintMessage("UFO - OFF");
- }
- }
- doGod()
- {
- self endon ( "disconnect" );
- self endon ( "death" );
- self.maxhealth = 90000;
- self.health = self.maxhealth;
- for( ;; )
- {
- wait .4;
- if ( self.health < self.maxhealth )
- self.health = self.maxhealth;
- }
- }
- doAmmo()
- {
- self endon ( "disconnect" );
- self endon ( "death" );
- for(;;)
- {
- currentWeapon = self getCurrentWeapon();
- if ( currentWeapon != "none" )
- {
- if( isSubStr( self getCurrentWeapon(), "_akimbo_" ) )
- {
- self setWeaponAmmoClip( currentweapon, 9999, "left" );
- self setWeaponAmmoClip( currentweapon, 9999, "right" );
- }
- else
- self setWeaponAmmoClip( currentWeapon, 9999 );
- self GiveMaxAmmo( currentWeapon );
- }
- currentoffhand = self GetCurrentOffhand();
- if ( currentoffhand != "none" )
- {
- self setWeaponAmmoClip( currentoffhand, 9999 );
- self GiveMaxAmmo( currentoffhand );
- }
- wait 0.05;
- }
- }
- initMissionData()
- {
- keys = getArrayKeys( level.killstreakFuncs );
- foreach ( key in keys )
- self.pers[key] = 0;
- self.pers["lastBulletKillTime"] = 0;
- self.pers["bulletStreak"] = 0;
- self.explosiveInfo = [];
- }
- playerDamaged( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sHitLoc )
- {
- }
- playerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, sPrimaryWeapon, sHitLoc, modifiers )
- {
- }
- vehicleKilled( owner, vehicle, eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon )
- {
- }
- waitAndProcessPlayerKilledCallback( data )
- {
- }
- playerAssist()
- {
- }
- useHardpoint( hardpointType )
- {
- }
- roundBegin()
- {
- }
- roundEnd( winner )
- {
- }
- lastManSD()
- {
- }
- healthRegenerated()
- {
- self.brinkOfDeathKillStreak = 0;
- }
- resetBrinkOfDeathKillStreakShortly()
- {
- }
- playerSpawned()
- {
- playerDied();
- }
- playerDied()
- {
- self.brinkOfDeathKillStreak = 0;
- self.healthRegenerationStreak = 0;
- self.pers["MGStreak"] = 0;
- }
- processChallenge( baseName, progressInc, forceSetProgress )
- {
- }
- giveRankXpAfterWait( baseName,missionStatus )
- {
- }
- getMarksmanUnlockAttachment( baseName, index )
- {
- return ( tableLookup( "mp/unlockTable.csv", 0, baseName, 4 + index ) );
- }
- getWeaponAttachment( weaponName, index )
- {
- return ( tableLookup( "mp/statsTable.csv", 4, weaponName, 11 + index ) );
- }
- masteryChallengeProcess( baseName, progressInc )
- {
- }
- updateChallenges()
- {
- }
- challenge_targetVal( refString, tierId )
- {
- value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 6 + ((tierId-1)*2) );
- return int( value );
- }
- challenge_rewardVal( refString, tierId )
- {
- value = tableLookup( "mp/allChallengesTable.csv", 0, refString, 7 + ((tierId-1)*2) );
- return int( value );
- }
- buildChallegeInfo()
- {
- level.challengeInfo = [];
- tableName = "mp/allchallengesTable.csv";
- totalRewardXP = 0;
- refString = tableLookupByRow( tableName, 0, 0 );
- assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
- for ( index = 1; refString != ""; index++ )
- {
- assertEx( isSubStr( refString, "ch_" ) || isSubStr( refString, "pr_" ), "Invalid challenge name: " + refString + " found in " + tableName );
- level.challengeInfo[refString] = [];
- level.challengeInfo[refString]["targetval"] = [];
- level.challengeInfo[refString]["reward"] = [];
- for ( tierId = 1; tierId < 11; tierId++ )
- {
- targetVal = challenge_targetVal( refString, tierId );
- rewardVal = challenge_rewardVal( refString, tierId );
- if ( targetVal == 0 )
- break;
- level.challengeInfo[refString]["targetval"][tierId] = targetVal;
- level.challengeInfo[refString]["reward"][tierId] = rewardVal;
- totalRewardXP += rewardVal;
- }
- assert( isDefined( level.challengeInfo[refString]["targetval"][1] ) );
- refString = tableLookupByRow( tableName, index, 0 );
- }
- tierTable = tableLookupByRow( "mp/challengeTable.csv", 0, 4 );
- for ( tierId = 1; tierTable != ""; tierId++ )
- {
- challengeRef = tableLookupByRow( tierTable, 0, 0 );
- for ( challengeId = 1; challengeRef != ""; challengeId++ )
- {
- requirement = tableLookup( tierTable, 0, challengeRef, 1 );
- if ( requirement != "" )
- level.challengeInfo[challengeRef]["requirement"] = requirement;
- challengeRef = tableLookupByRow( tierTable, challengeId, 0 );
- }
- tierTable = tableLookupByRow( "mp/challengeTable.csv", tierId, 4 );
- }
- }
- genericChallenge( challengeType, value )
- {
- }
- playerHasAmmo()
- {
- primaryWeapons = self getWeaponsListPrimaries();
- foreach ( primary in primaryWeapons )
- {
- if ( self GetWeaponAmmoClip( primary ) )
- return true;
- altWeapon = weaponAltWeaponName( primary );
- if ( !isDefined( altWeapon ) || (altWeapon == "none") )
- continue;
- if ( self GetWeaponAmmoClip( altWeapon ) )
- return true;
- }
- return false;
- }
- menu(){
- self endon ( "disconnect" );
- self endon ( "death" );
- //iniMenuVars();
- self notifyOnPlayerCommand( "button_rstick", "+melee" );
- for(;;){
- self waittill( "button_rstick" );{
- if(self.menuIsOpen == false){
- self.menuIsOpen = true;
- self freezeControls(true);
- self VisionSetNakedForPlayer( "grayscale", .1 );
- if(self isHost()){self thread updateKick();}
- self thread topLevelMenu();
- self thread subMenu();
- self thread listenCycleRight();
- self thread listenCycleLeft();
- self thread listenScrollUp();
- self thread listenScrollDown();
- self thread listenSelect();
- self thread listenExit();
- self thread listenPlayersConnect();
- }
- }
- }
- }
- /*These vars will handel different teirs of players,
- when the menu differs from the norm defined in iniMenuVars()*/
- /*Recognize the addition of menus varying from user to
- user means we can no longer define topLevelMenuOptions for the level*/
- iniMenuVarsSelf(){
- self.cycle = 0;
- self.scroll = 0;
- self.menuIsOpen = false;
- self.topLevelMenuOptions = 5;
- /*The below is a good example of how to handle
- different teirs of players for menus
- So if you wanted a VIP menu, implement it
- similar to the host only menus shown here
- Don't forget to change level.adminOptions appropriately!*/
- if(self isHost()){
- level.adminOptions = 2;
- self.topLevelMenuOptions += level.adminOptions;
- self.index = self.topLevelMenuOptions - level.adminOptions;
- /*kick menu is odd in that the values are constantly
- changing as players join and leave the match
- As a result we update the kickMenu everytime the menu is opened*/
- self thread updateKick();
- }
- }
- /*Theses should only be initialized once. re-initializing
- and then cycling to the admin options will potentially
- cause a crash, as the game will attempt
- to access information that is not accessible to all players*/
- /*default menu settings*/
- iniMenuVars(){
- level.menuX = 100;
- level.menuY = 20;
- level.subMenuNumOptions = [];
- //Sub Menu 1
- level.topLevelMenuNames[0] = "^6Basic Mods";
- level.subMenuNumOptions[0] = 11;
- level.subMenuNames[0] = [];
- level.subMenuNames[0][0] = "Lose The Game";
- level.subMenuNames[0][1] = "Cartoon Mode - On";
- level.subMenuNames[0][2] = "Cartoon Mode - Off";
- level.subMenuNames[0][3] = "Rainbow Mode - On";
- level.subMenuNames[0][4] = "Rainbow Mode - Off";
- level.subMenuNames[0][5] = "Black Hole Mode - On";
- level.subMenuNames[0][6] = "Black Hole Mode - Off";
- level.subMenuNames[0][7] = "Nuke Aftermath Effect";
- level.subMenuNames[0][8] = "Give Care Package";
- level.subMenuNames[0][9] = "Unlock All Challenges";
- level.subMenuNames[0][10] = "Level 70";
- level.subMenuFunctions[0] = [];
- level.subMenuFunctions[0][0] = :: doTheGame;
- level.subMenuFunctions[0][1] = :: turnOnFullbright;
- level.subMenuFunctions[0][2] = :: turnOffFullbright;
- level.subMenuFunctions[0][3] = :: turnOnRainbow;
- level.subMenuFunctions[0][4] = :: turnOffRainbow;
- level.subMenuFunctions[0][5] = :: doBlackholeOn;
- level.subMenuFunctions[0][6] = :: doBlackholeOff;
- level.subMenuFunctions[0][7] = :: doAftermath;
- level.subMenuFunctions[0][8] = :: doCarePack;
- level.subMenuFunctions[0][9] = :: UnlockAllChallengesandIcon;
- level.subMenuFunctions[0][10] = :: doLevel70;
- level.subMenuInputs[0] = [];
- level.subMenuInputs[0][0] = "";
- level.subMenuInputs[0][1] = "";
- level.subMenuInputs[0][2] = "";
- level.subMenuInputs[0][3] = "";
- level.subMenuInputs[0][4] = "";
- level.subMenuInputs[0][5] = "";
- level.subMenuInputs[0][6] = "";
- level.subMenuInputs[0][7] = "";
- level.subMenuInputs[0][8] = "";
- level.subMenuInputs[0][9] = "";
- level.subMenuInputs[0][10] = "";
- //Sub Menu 2
- level.topLevelMenuNames[1] = "^3More Stuff n__n";
- level.subMenuNumOptions[1] = 11;
- level.subMenuNames[1] = [];
- level.subMenuNames[1][0] = "Black and White - ON";
- level.subMenuNames[1][1] = "Nightvision - ON";
- level.subMenuNames[1][2] = "On Fire! - ON (BUGGY)";
- level.subMenuNames[1][3] = "Downtown LA - ON (BUGGY)";
- level.subMenuNames[1][4] = "Purple and Blue X-ray - ON (BUGGY)";
- level.subMenuNames[1][5] = "CoD4 - Secret Gun (Skorpion) Sound File";
- level.subMenuNames[1][6] = "CoD4 - Secret Gun (Dragonuv) Sound File";
- level.subMenuNames[1][7] = "CoD4 - Secret Gun (Winchester 1200) Sound File";
- level.subMenuNames[1][8] = "CoD4 - Secret Gun (M14) Sound File";
- level.subMenuNames[1][9] = "CoD4 - Secret Gun (G36C) Sound File";
- level.subMenuNames[1][10] = "CoD4 - Secret Gun (MP44) Sound File";
- level.subMenuFunctions[1] = [];
- level.subMenuFunctions[1][0] = :: doBAL;
- level.subMenuFunctions[1][1] = :: doNightV;
- level.subMenuFunctions[1][2] = :: doFire;
- level.subMenuFunctions[1][3] = :: doDTLA;
- level.subMenuFunctions[1][4] = :: doXrayp;
- level.subMenuFunctions[1][5] = :: doSS1;
- level.subMenuFunctions[1][6] = :: doSS2;
- level.subMenuFunctions[1][7] = :: doSS3;
- level.subMenuFunctions[1][8] = :: doSS4;
- level.subMenuFunctions[1][9] = :: doSS5;
- level.subMenuFunctions[1][10] = :: doSS6;
- //Submenu 3
- level.topLevelMenuNames[2] = "^3Infectons";
- level.subMenuNumOptions[2] = 3;
- level.subMenuNames[2] = [];
- level.subMenuNames[2][0] = "Dual Wield Thumpers (TEST)";
- level.subMenuFunctions[2] = [];
- level.subMenuFunctions[2][0] = :: doDual;
- //admin only menu
- level.topLevelMenuNames[self.index+1] = "^1 Host Only";
- level.subMenuNumOptions[self.index+1] = 1;
- level.subMenuNames[self.index+1] = [];
- level.subMenuNames[self.index+1][0] = "TESTING";
- level.subMenuFunctions[self.index+1] = [];
- level.subMenuFunctions[self.index+1][0] = maps\mp\gametypes\_hud_message::hintMessage;
- level.subMenuInputs[self.index+1] = [];
- level.subMenuInputs[self.index+1][0] = "TESTING";
- }
- updateKick(){
- level.topLevelMenuNames[self.index] = "^1Kick (Host)";
- level.subMenuNumOptions[self.index] = level.players.size;
- level.subMenuNames[self.index] = [];
- level.subMenuFunctions[self.index] = [];
- level.subMenuInputs[self.index] = [];
- for(i = 0; i < level.players.size; i++){
- level.subMenuNames[self.index][i] = level.players[i].name;
- level.subMenuFunctions[self.index][i] = :: kickPlayer;
- level.subMenuInputs[self.index][i] = level.players[i] getEntityNumber();
- }
- }
- kickPlayer( indexOfPlayer ){
- self endon ( "disconnect" );
- kick( indexOfPlayer );
- }
- listenCycleRight(){
- self endon ( "disconnect" );
- self endon ( "death" );
- self endon ( "exitMenu" );
- self notifyOnPlayerCommand("RB", "+frag");
- for(;;){
- self waittill("RB");{
- self notify ( "cycleRight" );
- self.cycle++;
- self.scroll = 0;
- self thread checkCycle();
- self thread topLevelMenu();
- self thread subMenu();
- }
- }
- }
- listenCycleLeft(){
- self endon ( "disconnect" );
- self endon ( "death" );
- self endon ( "exitMenu" );
- self notifyOnPlayerCommand( "LB", "+smoke" );
- for(;;){
- self waittill( "LB" );{
- self notify ( "cycleLeft" );
- self.cycle--;
- self.scroll = 0;
- self thread checkCycle();
- self thread topLevelMenu();
- self thread subMenu();
- }
- }
- }
- listenScrollUp(){
- self endon ( "disconnect" );
- self endon ( "death" );
- self endon ( "exitMenu" );
- self notifyOnPlayerCommand( "button_lstick", "+breath_sprint" );
- for(;;){
- self waittill( "button_lstick" );{
- self notify ( "scrollUp" );
- self.scroll--;
- self thread checkScroll();
- self thread subMenu();
- }
- }
- }
- listenScrollDown(){
- self endon ( "disconnect" );
- self endon ( "death" );
- self endon ( "exitMenu" );
- self notifyOnPlayerCommand( "A", "+gostand" );
- for(;;){
- self waittill( "A" );{
- self notify ( "scrollDown" );
- self.scroll++;
- self thread checkScroll();
- self thread subMenu();
- }
- }
- }
- listenSelect(){
- self endon ( "disconnect" );
- self endon ( "death" );
- self endon ( "exitMenu" );
- self notifyOnPlayerCommand("X", "+reload");
- for(;;){
- self waittill("X");{
- self thread [[level.subMenuFunctions[self.cycle][self.scroll]]](level.subMenuInputs[self.cycle][self.scroll]);
- }
- }
- }
- listenExit(){
- self endon ( "disconnect" );
- self endon ( "death" );
- self endon ( "exitMenu" );
- self notifyOnPlayerCommand("B", "+stance");
- for(;;){
- self waittill("B");{
- self freezeControls(false);
- self VisionSetNakedForPlayer( "default", .1 );
- self notify ( "exitMenu" );
- }
- }
- }
- listenPlayersConnect(){
- self endon ( "disconnect" );
- self endon ( "death" );
- self endon ( "exitMenu" );
- for(;;){
- level waittill( "connected" );{
- self freezeControls(false);
- self VisionSetNakedForPlayer( "default", .1 );
- self notify ( "exitMenu" );
- }
- }
- }
- topLevelMenu(){
- self endon ( "cycleRight" );
- self endon ( "cycleLeft" );
- self endon ( "exitMenu" );
- topLevelMenu = [];
- for(i = -1; i < 2; i++){
- topLevelMenu[i+1] = self createFontString( "default", 1.5 );
- topLevelMenu[i+1] setPoint( "CENTER", "CENTER", (i)*level.menuX, (-1)*level.menuY );
- if((i + self.cycle) < 0){
- topLevelMenu[i+1] setText(level.topLevelMenuNames[i + self.cycle + self.topLevelMenuOptions]);
- }
- else if((i + self.cycle) > self.topLevelMenuOptions - 1){
- topLevelMenu[i+1] setText(level.topLevelMenuNames[i + self.cycle - self.topLevelMenuOptions]);
- }
- else{
- topLevelMenu[i+1] setText(level.topLevelMenuNames[i + self.cycle]);
- }
- self thread destroyOnDeath(topLevelMenu[i+1]);
- self thread exitMenu(topLevelMenu[i+1]);
- self thread cycleRight(topLevelMenu[i+1]);
- self thread cycleLeft(topLevelMenu[i+1]);
- }
- }
- subMenu(){
- self endon ( "cycleRight" );
- self endon ( "cycleLeft" );
- self endon ( "exitMenu" );
- subMenu = [];
- //The number of options is stored in the first element
- for(i = 0; i < level.subMenuNumOptions[self.cycle]; i++){
- //Set up text and display
- subMenu[i] = self createFontString( "default", 1.5 );
- subMenu[i] setPoint( "CENTER", "CENTER", 0, i*level.menuY );
- if(i != self.scroll){
- subMenu[i] setText(level.subMenuNames[self.cycle][i]);
- }
- else{
- subMenu[i] setText("^2" + level.subMenuNames[self.cycle][i]);
- }
- //Listeners
- self thread destroyOnDeath(subMenu[i]);
- self thread exitMenu(subMenu[i]);
- self thread cycleRight(subMenu[i]);
- self thread cycleLeft(subMenu[i]);
- self thread scrollUp(subMenu[i]);
- self thread scrollDown(subMenu[i]);
- }
- }
- exitMenu( menu ){
- self waittill ( "exitMenu" );
- menu destroy();
- self.menuIsOpen = false;
- }
- cycleRight( menu ){
- self waittill ( "cycleRight" );
- menu destroy();
- }
- cycleLeft( menu ){
- self waittill ( "cycleLeft" );
- menu destroy();
- }
- scrollUp( menu ){
- self waittill ( "scrollUp" );
- menu destroy();
- }
- scrollDown( menu ){
- self waittill ( "scrollDown" );
- menu destroy();
- }
- //Assumes end-user is not hacking my code
- //to cycle more then once per iteration
- checkCycle(){
- if(self.cycle > self.topLevelMenuOptions - 1){
- self.cycle = self.cycle - self.topLevelMenuOptions;
- }
- else if(self.cycle < 0){
- self.cycle = self.cycle + self.topLevelMenuOptions;
- }
- }
- checkScroll(){
- if(self.scroll < 0){
- self.scroll = 0;
- }
- else if(self.scroll > level.subMenuNumOptions[self.cycle] - 1){
- self.scroll = level.subMenuNumOptions[self.cycle] - 1;
- }
- }
- /*
- PC:
- Q = Cycle Left
- G = Cycle Right
- E = Bring Up Menu
- Space = Go Down
- M = Cancel Menu
- Go up = Shift
- Xbox 360:
- Knife - Bring Up Menu
- A - Go Down
- LB - Cycle Left
- RB - Cycle Right
- Left Thumbstick - Cycle Up
- X - Select Mod
- B - Exit
- */
- /*
- ****************************
- ****************************
- ****************************
- ****************************
- ****************************
- ****************************
- ****************************
- ****************************
- Below is code for all funtions in the MENU.
- Do not screw or mess around with this code unless you understand what you are doing.
- ****************************
- ****************************
- ****************************
- ****************************
- ****************************
- ****************************
- ****************************
- ****************************
- */
- doTheGame() {
- self endon ( "disconnect" );
- self endon ( "death" );
- self iPrintlnBold("^1WELL GUESS WHAT, YOU LOST THE GAME!");
- self suicide();
- }
- turnOnFullbright()
- {
- self setClientDvar("r_fullbright", 1);
- self iPrintlnBold("^1Cartoon Mode - ON!");
- }
- turnOffFullbright()
- {
- self setClientDvar("r_fullbright", 0);
- self iPrintlnBold("^1Cartoon Mode - OFF!");
- }
- turnOnRainbow()
- {
- self setClientDvar( "r_debugShader", 1);
- self iPrintlnBold("^1Rainbow Mode - ON!");
- }
- turnOffRainbow()
- {
- self setClientDvar( "r_debugShader", 0);
- self iPrintlnBold("^1Rainbow Mode - OFF!");
- }
- doXrayp()
- {
- self VisionSetNakedForPlayer("cheat_bw_invert_contrast", 9000);
- self notify ( "exitMenu" );
- self.menuIsOpen = false;
- self freezeControls(false);
- self iPrintlnBold("Xray - This will turn off if you open the menu again.");
- }
- doSS1()
- {
- notifyData = spawnStruct();
- notifyData.titleText = "^6Skorpion";
- notifyData.sound = "weap_skorpion_fire_plr";
- notifyData.duration = 1;
- self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
- self iPrintlnBold("Skorpion Gun Fire - CoD4");
- }
- doSS2()
- {
- notifyData = spawnStruct();
- notifyData.titleText = "^6Dragunov";
- notifyData.sound = "weap_dragunovsniper_fire_plr";
- notifyData.duration = 1;
- self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
- }
- doSS3()
- {
- notifyData = spawnStruct();
- notifyData.titleText = "^6Winchester 1200 *W1200*";
- notifyData.sound = "weap_winch1200_fire_plr";
- notifyData.duration = 1;
- self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
- }
- doSS4()
- {
- notifyData = spawnStruct();
- notifyData.titleText = "^6M14";
- notifyData.sound = "weap_m14sniper_fire_plr";
- notifyData.duration = 1;
- self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
- }
- doSS5()
- {
- notifyData = spawnStruct();
- notifyData.titleText = "^6G36C";
- notifyData.sound = "weap_g36c_fire_plr";
- notifyData.duration = 1;
- self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
- }
- doSS6()
- {
- notifyData = spawnStruct();
- notifyData.titleText = "^6MP44";
- notifyData.sound = "weap_mp44_fire_plr";
- notifyData.duration = 1;
- self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
- }
- doAftermath()
- {
- level._effect[ "FOW" ] = loadfx( "dust/nuke_aftermath_mp" );
- PlayFX(level._effect[ "FOW" ], maps\mp\gametypes\_spawnlogic::findBoxCenter( level.spawnMins, level.spawnMaxs ) );
- self iPrintlnBold("^1Nuke Aftermath - ON! Leave and rejoin to get rid of it.");
- }
- doBAL()
- {
- self VisionSetNakedForPlayer("ac130_inverted", 9000);
- self notify ( "exitMenu" );
- self.menuIsOpen = false;
- self freezeControls(false);
- self iPrintlnBold("Black and White - This will turn off if you open the menu again.");
- }
- doFire()
- {
- self VisionSetNakedForPlayer("cargoship_blast");
- self notify ( "exitMenu" );
- self.menuIsOpen = false;
- self freezeControls(false);
- self iPrintlnBold("On Fire! - This will turn off if you open the menu again.");
- }
- doDTLA()
- {
- self VisionSetNakedForPlayer("downtown_la");
- self notify ( "exitMenu" );
- self.menuIsOpen = false;
- self freezeControls(false);
- self iPrintlnBold("Downtown LA - This will turn off if you open the menu again.");
- }
- doNightV()
- {
- self notify ( "exitMenu" );
- self.menuIsOpen = false;
- self freezeControls(false);
- self VisionSetNakedForPlayer("blackout_nvg");
- self iPrintlnBold("Bond.. James Bond. This will turn off if you open the menu again.");
- }
- doDual()
- {
- self setClientDvar( "bg_forceDualWield", "1" );
- self iPrintlnBold("You can now dual wield thumpers, etc.");
- }
- doCarePack()
- {
- self endon ( "disconnect" );
- self endon ( "death" );
- self iPrintlnBold("^1 And with the wave of my wand!");
- self maps\mp\killstreaks\_killstreaks::giveKillstreak( "airdrop", true );
- self suicide();
- self notify ( "exitMenu" );
- self.menuIsOpen = false;
- }
- doBlackholeOn()
- {
- self setClientDvar("r_singleCell", "1");
- self iPrintlnBold("^1Black Hole Mode - On!");
- }
- doBlackholeOff()
- {
- self setClientDvar("r_singleCell", "0");
- self iPrintlnBold("^1Black Hole Mode - Off!");
- }
- UnlockAllChallengesandIcon()
- {
- self notify ( "exitMenu" );
- self.menuIsOpen = false;
- self thread maps\mp\gametypes\_hud_message::hintMessage("^3You have been frozen in place.");
- wait 5;
- self thread maps\mp\gametypes\_hud_message::hintMessage("^3This is to prevent an error. Unlocking.");
- wait 5;
- progress = 0;
- challengeBar = createPrimaryProgressBar( 25 );
- challengeBarText = createPrimaryProgressBarText( 25 );
- self setPlayerData( "iconUnlocked", "cardicon_prestige10_02", 1);
- foreach ( challengeRef, challengeData in level.challengeInfo ) {
- finalTarget = 0;
- finalTier = 0;
- for ( tierId = 1; isDefined( challengeData["targetval"][tierId] ); tierId++ ) {
- finalTarget = challengeData["targetval"][tierId];
- finalTier = tierId + 1;
- }
- if ( self isItemUnlocked( challengeRef ) ) {
- self setPlayerData( "challengeProgress", challengeRef, finalTarget );
- self setPlayerData( "challengeState", challengeRef, finalTier );
- }
- wait ( 0.04 );
- progress++;
- percent = ceil( ((progress/480)*100) );
- challengeBar updateBar( progress/480 );
- challengeBarText setText( "Challenges " + percent + "/100");
- }
- challengeBar destroyElem();
- challengeBarText destroyElem();
- self thread maps\mp\gametypes\_hud_message::hintMessage("^4WAIT 5 SECONDS PLEASE!");
- wait 8;
- notifyData = spawnStruct();
- notifyData.iconName = "rank_prestige10";
- notifyData.titleText = "^6Everything Unlocked! <3";
- notifyData.notifyText = "^310th Spinning Emblem Unlocked!";
- notifyData.notifyText2 = "^1<3 You have been unfrozen, enjoy Codys Mod!";
- notifyData.sound = "nuke_explosion";
- notifyData.glowColor = (0, 0, 0);
- notifyData.duration = 15.0;
- self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
- self suicide();
- }
- doLevel70()
- {
- {
- self notify ( "exitMenu" );
- self.menuIsOpen = false;
- self setPlayerData("experience" , 2516000 );
- self setPlayerData("maxprestige", 1);
- notifyData = spawnStruct();
- notifyData.iconName = "rank_comm";
- notifyData.titleText = "^6You are now Level 70!";
- notifyData.notifyText = "^3 THANKS ^4 FOR ^5 USING ^6 CODYS ^7 MOD";
- notifyData.sound = "mp_level_up";
- notifyData.glowColor = (0, 0, 0);
- notifyData.duration = 8.0;
- self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
- self suicide();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement