1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Release Black Ops 2 GSC Managed Code List

Discussion in 'Call of Duty: Black Ops 2 Scripts' started by CabCon, Feb 14, 2016.

  1. VerTical

    VerTical Head Member Donator

    1,002
    1,215
    273
    Credits:
    2,802
    WoW Nice :wink:
     
    DF_AUS likes this.
  2. chadbell

    chadbell Active Member

    40
    12
    18
    Credits:
    186
    Nice post well handy thank you to all contributors
     
    DF_AUS and CabCon like this.
  3. RLZ PBCT

    RLZ PBCT C Sharp Programmer

    174
    238
    218
    Credits:
    1,327
    Nice Mr.CabCon
     
    CabCon likes this.
  4. zerker24

    zerker24 Developer

    35
    42
    18
    Credits:
    442
    Looks like we could use more scripts.

    Here is the newest edition to my menu. I call it advanced hit markers. Basically the hit marker is red if you shoot an enemy, and green if you shoot a teammate. There is also a killed player message with headshot detection.

    Advanced Hit Markers.
    This script is by: Zerker24
    PHP:
    toggleAdvHit()
    {
       if (!
    isdefined(self.bools["hitmk"]))
           
    self.bools["hitmk"] = false;
     
       if (!
    isdefined(self.crosshairs))
               
    self.crosshairs = [];

       if (!
    isdefined(self.lastHitCount))
           
    self.lastHitCount 0;
     
       foreach (
    player in level.players)
       {
           
    player thread advHitLoop();
       }
       if (
    self.bools["hitmk"] == false)
       {
           
    self.bools["hitmk"] = true;
           
    self iPrintln("Hit MK [^2ON^7]");
       }
       else
       {
           
    self.bools["hitmk"] = false;
           
    self iPrintln("Hit MK [^1OFF^7]");
       }
    }

    advHitLoop()
    {
       
    self endon("disconnect");
       
    level endon("stopHitmk");
       for(;;)
       {
           
    self waittill("damage"damageattackerdirection_vecpointtypemodelnametagnamepartnameweaponname);
           if (
    attacker.bools["hitmk"])
           {
               if (
    self.team == attacker.team)
               {
                   
    attacker thread drawHitMkr((010));
                   if (
    self.health == 0)
                   {
                       if (
    type == "MOD_HEAD_SHOT")
                           
    attacker iPrintlnbold("You Headshot ^2" getPlayerName(self));
                       else
                           
    attacker iPrintlnbold("You Killed ^2" getPlayerName(self));
                   }
               }
               else
               {
                   
    attacker thread drawHitMkr((100));
                   if (
    self.health == 0)
                   {
                       if (
    type == "MOD_HEAD_SHOT")
                           
    attacker iPrintlnbold("You Headshot ^1" getPlayerName(self));
                       else
                           
    attacker iPrintlnbold(" You Killed ^1" getPlayerName(self));
                   }
               }
           }
           
    wait 0.05;
       }
    }

    drawHitMkr(color)
    {
       
    totNum self.crosshairs.size 1;
       
    self.crosshairs[totNum] = CHdrawShader("damage_feedback"0122448color1999);
       
    self.crosshairs[totNumsetPoint"CENTER""CENTER"012 );
       
    self.crosshairs[totNumFadeOverTime(1);
       
    self.crosshairs[totNum].alpha 0;
       
    wait 1;
       
    self.crosshairs[totNumdestroy();
    }

    clearHitMkr()
    {
       
    level endon("stopHitmk");
       for (;;)
       {
           
    wait 3;
           if (
    self.lastHitCount == self.crosshairs.size)
           {
               
    self.crosshairs = [];
               
    self.lastHitCount 0;
           }
       }
    }

    CHdrawShader(shaderxywidthheightcoloralphasort)
    {
       
    hud newClientHudElem(self);
       
    hud.elemtype "icon";
       
    hud.color color;
       
    hud.alpha alpha;
       
    hud.sort sort;
       
    hud.children = [];
       
    hud setParent(level.uiParent);
       
    hud setShader(shaderwidthheight);
       
    hud.x;
       
    hud.y;
       
    hud.archived false;
       return 
    hud;
    }

    Don't forget to pre cache "damage_feedback".
     
    Last edited: Dec 14, 2016
    CabCon, DF_AUS and The Dark Side like this.
  5. BLUELOCC

    BLUELOCC New Member

    2
    1
    3
    Credits:
    32
    can someone please help me make a gsc mod menu im such a noob lol
     
  6. CabCon

    CabCon Head Administrator Staff Member

    3,431
    2,139
    293
    Credits:
    85,381
    If you are looking for gsc tutorials or stuff like that, take a look inside this section: Please login or register to view links or downloads!
    If you need help with something, create a thread inside our question section: Please login or register to view links or downloads!
     
    RosticGamer99 likes this.
  7. legit

    legit Member

    17
    6
    8
    Credits:
    267
     
  8. Falcon!

    Falcon! Active Member

    38
    28
    28
    Credits:
    388
    My XP Lobby Script.

    #includes
    This Script is by: @XeFalcon Modz
    PHP:
    #include maps/mp/gametypes/_globallogic;
    #include maps/mp/gametypes/_gamelogic;

    Put On Init().
    This Script is by: @XeFalcon Modz
    PHP:
    level.Colours strTok("34|64|139|135|38|87|135|206|250|255|23|153|0|255|0|101|67|33|0|0|255|255|0|0|255|128|0|153|26|255|0|255|255|255|255|0|0|0|0|255|255|255""|");

    Put on onPlayerSpawned().
    This Script is by: @XeFalcon Modz
    PHP:
    if(isDefined(level.xpLobby))
    self thread StartXPGain();

    Utilities Needed.
    This Script is by: @XeFalcon Modz
    PHP:
    lobbyMsg(stringtimealignrelative)
    {
        if(!
    isDefined(align)) align "CENTER";
        if(!
    isDefined(relative)) relative "TOP";
        if(!
    isDefined(string)) string "Undefined String!";
        
    message level createText("default"2alignrelative00111string, (1,1,1), true);
        if(!
    isDefined(time))
        
    wait 4;
        else 
    wait time;
        
    message destroy();
    }

    divideColor(c1c2c3ignore)
    {
     if(
    isDefined(ignore))
      return (
    c1c2c3);
     return (
    c1 /255c2 /255c3 /255);
    }

    XP Lobby.
    This Script is by: @XeFalcon Modz
    PHP:
    //▀▄▒▄▀ ▒█▀▀█   ▒█░░░ ▒█▀▀▀█ ▒█▀▀█ ▒█▀▀█ ▒█░░▒█
    //░▒█░░ ▒█▄▄█   ▒█░░░ ▒█░░▒█ ▒█▀▀▄ ▒█▀▀▄ ▒█▄▄▄█
    //▄▀▒▀▄ ▒█░░░   ▒█▄▄█ ▒█▄▄▄█ ▒█▄▄█ ▒█▄▄█ ░░▒█░░
    BeginXPlobby()//XP LOBBY TOGGLE.
    {
        if(!
    isDefined(level.BeginxpLobby))
        {
            
    level.BeginxpLobby true;
            
    self iprintln("XP Gain Match - ^2Active");
            
    self thread closeMenu();
            
    self FreezeControlsAllowLookXP(true);
            
    level thread checkforfeit();
            
    self thread XPlobbyTweakable(4true);
            
    self thread XPLobbyStartTimer("XP GAIN MATCH BEGINS IN"10);
            
    self thread InfiniteGameDvarsXP();
            
    wait 10;
            
    self FreezeControlsAllowLookXP(false);
            
    self thread KickAllClientsXP();
            
    self thread LoadXPGain();
            
    wait 3;
            
    self thread XPlobbyTweakable(1false);
            
    self thread NoHateCrimes(true);
            if(!
    isDefined(level.XPLobbyBeginText))
            {
                
    level.XPLobbyBeginText true;
                
    level.XPLobbyText level createServerFontString("hudbig"5);
                
    level.XPLobbyText setPoint("CENTER""TOP"022);
                
    level.XPLobbyText setSafeText("XP Gain Match");
                
    level.XPLobbyText.alpha 1;
                
    level.XPLobbyToggle true;
                for(;;)
                {
                    for(
    0< (level.Colours.size 3); i++)
                    {
                        
    level.XPLobbyText.color dividecolor(int(level.Colours[3*i]), int(level.Colours[(3*i)+1]), int(level.Colours[(3*i)+2]));
                        
    level.XPLobbyText FadeOverTime(1);
                        
    level.XPLobbyText.glowcolor dividecolor(int(level.Colours[3*i]), int(level.Colours[(3*i)+1]), int(level.Colours[(3*i)+2]));
                        
    level.XPLobbyText FadeOverTime(1);
                        
    level.XPLobbyText.GlowAlpha 1;
                        
    wait 1;
                    }
                    
    wait 0.05;
                }
            }
            else if(!
    isDefined(level.XPLobbyToggle))
            {
                
    level.XPLobbyToggle true;
                
    level.XPlobbyText.alpha 1;
            }
        }
        else
        {
            
    level.xpLobby undefined;
            
    level.kacx undefined;
            
    level.BeginxpLobby undefined;
            
    self iprintln("XP Gain Match - ^1Un - Active");
            
    self thread UndoInfiniteGameDvarsXP();
            
    self thread NoHateCrimes(false);
            if(
    isDefined(level.XPLobbyToggle))
            {
                
    level.XPlobbyText.alpha 0;
                
    level.XPLobbyToggle undefined;
                
    level.XPLobbyBeginText undefined;
                
    level.XPLobbyText destroy();
            }
        }
    }
    FreezeControlsAllowLookXP(reply)//FREEZE CONTROLS BUT ALLOW PLAYER TO LOOK DURING COUNTDOWN PERIOD
    {
        foreach(
    player in level.players)
        {
            if(
    reply == true)
                
    player freezecontrolsallowlook(true);
            if(
    reply == false)
                
    player freezecontrolsallowlook(false);
            if(!
    isDefined(reply))
                
    self lobbyMsg("FreezeControlsAllowLookXP() arg not defined!");
        }
    }
    UndoInfiniteGameDvarsXP()//UN-DO INFINITE GAME DVARS.
    {
        
    setDvar("scr_dom_scorelimit"1);
     
    setDvar("scr_sd_numlives"1);
     
    setDvar("scr_war_timelimit"1);
     
    setDvar("scr_game_onlyheadshots"0);
     
    setDvar("scr_war_scorelimit"1);
     
    maps/mp/gametypes/_globallogic_utils::resumetimer();
    }
    InfiniteGameDvarsXP()//INFINITE GAME DVARS.
    {
        
    setDvar("scr_dom_scorelimit"0);
     
    setDvar("scr_sd_numlives"0);
     
    setDvar("scr_war_timelimit"0);
     
    setDvar("scr_game_onlyheadshots"0);
     
    setDvar("scr_war_scorelimit"0);
     
    maps/mp/gametypes/_globallogic_utils::pausetimer();
    }
    XPLobbyStartTimer(stringtime)//XP COUNTDOWN TIMER.
    {
        
    level.preMatchPeriod time;
        
    game["strings"]["match_starting_in"] = string;
        
    thread matchStartTimer();
    }
    NoHateCrimes(reply)//NO KILLING DURING LOBBY.
    {
        
    self endon("disconnect");
        
    self endon("GoodPeople");
      
        for(;;)
        {
            foreach(
    player in level.players)
            {
                if(
    player.verStatus == "None")
                {
                    if(
    reply == true)
                        
    player EnableInvulnerability();
                    
    player takeAllWeapons();
                    if(
    reply == false)
                        
    player DisableInvulnerability();
                    
    player ClassChange();
                        
    self notify("GoodPeople");
                    if(!
    isDefined(reply))
                        
    self lobbyMsg("NoHateCrimes() arg not defined!"1);
                    
    self notify("GoodPeople");
                }
            }
            
    wait 0.05;
        }
    }
    XPlobbyTweakable(valuereply)//LOBBY TWEAKABLES I.E: SPEED.
    {
        
    self endon("disconnect");
        
    self endon("XPLobbyFuntimeOver");
      
        for(;;)
        {
            foreach(
    player in level.players)
            {
                if(
    player.verStatus == "None")
                {
                    if(
    isDefined(value) && reply == true)
                        
    player setmovespeedscale(value);
                    if(
    isDefined(value) && reply == false)
                        
    player setmovespeedscale(value);
                    
    self notify("XPLobbyFuntimeOver");
                    if(!
    isDefined(value) && !isDefined(reply))
                        
    self lobbyMsg("XPlobbyTweakable() arg's not defined!"1);
                    
    self notify("XPLobbyFuntimeOver");
                }
            }
            
    wait 0.05;
        }
    }
    checkforfeit()//CHECK FOR FORFEIT THEN ABORT FORFEIT.
    {
     
    level endon("game_ended");
     
     for(;;)
     {
      if(
    level.gameForfeited)
      {
       
    level.onForfeit false;
       
    level.gameForfeited false;
       
    level notify("abort forfeit");
      }
      
    wait 5;
     }
    }
    KickAllClientsXP()//KICK ALL PLAYERS TO PREPARE FOR XP LOBBY.
    {
        if(!
    isDefined(level.kacx))
        {
            
    level.kacx true;
            foreach(
    player in level.players)
            {
                if(
    player.verStatus == "None")
                {
                    
    kick(player getentitynumber());
                    
    wait .05;
                }
            }
            
    self LobbyMsg("ALL PLAYERS KICKED FROM SESSION"3);
        }
    }
    LoadXPGain()//Begin StartXPGain Thread If Level.xpLobby is defined.
    {
     if(!
    isDefined(level.xpLobby) && self isHost())
     {
          
    level.xpLobby true;
      foreach(
    player in level.players)
       
    player thread StartXPGain();
     }
     else if(
    isDefined(level.xpLobby) && self isHost())
                
    level.xpLobby undefined;
    }
    StartXPGain()//START GIVING XP ON IF STATEMENTS.
    {
     if(
    self.verStatus == "None" && self.pers["prestige"] != level.maxPrestige && self.pers["rank"] != level.maxRank)
     {
      
    self addrankxpvalue("contract"60000);
      
    self iprintlnbold("^160000 xp ^5received!, ^7you will now be kicked, rejoin.");
      
    wait 3.1;
         
    kick(self getentitynumber());
     }
     else if(
    self.verStatus == "None" && self.pers["prestige"] == level.maxPrestige && self.pers["rank"] == level.maxRank)
     {
         
    self iprintlnbold("^5You are already max level, ^1you will now be kicked");
         
    wait 3.1;
         
    kick(self getentitynumber());
     }
    }
     
    Last edited: Jun 22, 2017
  9. Falcon!

    Falcon! Active Member

    38
    28
    28
    Credits:
    388
    Change Gametype Script.

    Gamemodes like Sharpshooter, Gun Game, One In The Chamber, etc
    The Kills and Deaths Hud Looks Weird but every other gametype is fine, I just haven't figured out how to fix that issue yet.

    This Script is by: @XeFalcon Modz
    PHP:
    ChangeGametype(gametype)
    {
        if(
    level.gametype == gametype)
            return 
    self iprintln("Gametype is already ^5"gametype);

        
    level.gametype gametype;
        
    setDvar("ui_gametype"gametype);
        
    setDvar("g_gametype"gametype);
        
    makedvarserverinfo("ui_gametype"gametype);
        
    makedvarserverinfo("g_gametype"gametype);
        
    self.my["map"] = getDvar("mapname");
        
    level_doMap(self.my["map"]);
    }

    Change Map. needed For the func to work.
    This Script is by: @XeFalcon Modz
    PHP:
    level_doMap(mapR)
    {
     
    SetDvar("ls_mapname"mapR);
     
    SetDvar("mapname"mapR);
     
    SetDvar("party_mapname"mapR);
     
    SetDvar("ui_mapname"mapR);
     
    SetDvar("ui_currentMap"mapR);
     
    SetDvar("ui_mapname"mapR);
     
    SetDvar("ui_preview_map"mapR);
     
    SetDvar("ui_showmap"mapR);
     
    Map(mapR);
    }
     
    Last edited: Jun 24, 2017
  10. The Dark Side

    The Dark Side Trial Moderator Staff Member

    917
    692
    298
    Credits:
    2,731
    Pretty cool. The gamemode function is weird though isn't it? Do the gamemode objectives spawn like flags or bombs like they should?
     
    Falcon! likes this.
  11. Candy

    Candy G59 Terrorist Premium Member Donator

    621
    463
    238
    Credits:
    3,461
    Would you happen to add the game mode list with this?
     
  12. The Dark Side

    The Dark Side Trial Moderator Staff Member

    917
    692
    298
    Credits:
    2,731
    Might as well post a couple of my own. Figure this might help straighten some menus out a little.

    All Players Function, could be improved. But i've seen so many menus with separate all player functions. This'll help stop that.
    function is where you put the name of the function you wanna call on all players.
    D is the text param. Put whatever you want to come up on the screen there in place of D. (It WILL pop up for everyone)
    A, B, and C are all just extras. For codes that use more args.
    Code:
    AllPlayerFunction(function, D, A, B, C)
    {
        foreach(player in level.players)
        {
            player [[function]](A,B,C);
            player iPrintln(D);
        }
    }
    
    [​IMG]

    Same goes for this one. Hopefully you know how to call these but just in case you don't ill add a picture. Dont use multiple player functions that aren't needed!!!
    Code:
    PlayerFunction(player, function, D, A, B, C)
    {
        player [[function]](A,B,C);
        self iPrintlnbold("Called " + D + " on" + player.name);
    }
    [​IMG]
     
    Last edited: Jun 23, 2017
    Autistic, Falcon! and Candy like this.
  13. Candy

    Candy G59 Terrorist Premium Member Donator

    621
    463
    238
    Credits:
    3,461
    These are pretty cool, better than repeating a function just for all players.
     
    DF_AUS and The Dark Side like this.
  14. The Dark Side

    The Dark Side Trial Moderator Staff Member

    917
    692
    298
    Credits:
    2,731
    Code:
    tdm = Team Deathmatch
    dm = Free For All
    dom = Domination
    dem = Demolition
    conf = Kill Confirmed
    koth = Hardpoint
    sd = Search and Destroy
    hq = Headquarters
    oic = One In The Chamber
    gun = Gun Game
    shrp = Sharpshooter
    sas = Sticks and Stones
    ctf = Capture the Flag
    sab = Sabotage (Don't think this one is in Bo2, but ill leave it here anyway)
    tdef = Team Defender
       
    
    ---Hardcore---
                           
    hctdm = Hardcore Team Deathmatch
    hcdm = Hardcore Free For All
    hcctf = Hardcore Capture The Flag
    hcdom = Hardcore Domination
    hcsab = Hardcore Sabotage (Again, not sure. Lol)
    hcsd = Hardcore Search and Destroy
    hchq = Hardcore Headquarters
    hcdem = Hardcore Demolition
    

    There you go <3 :smile:
     
    Candy likes this.
  15. Candy

    Candy G59 Terrorist Premium Member Donator

    621
    463
    238
    Credits:
    3,461
    Thank you :grinning:
     
    The Dark Side likes this.
  16. Falcon!

    Falcon! Active Member

    38
    28
    28
    Credits:
    388
    yeah its weird lol, still tryna figure it out and yeah everything spawns as should.
     
    The Dark Side likes this.
  17. The Dark Side

    The Dark Side Trial Moderator Staff Member

    917
    692
    298
    Credits:
    2,731
    Just an FYI. Uh... You shouldn't thread your closemenu function. There isn't any reason for it to thread. It could end up freezing/crashing your game. :blush:
     
    DF_AUS likes this.
  18. DF_AUS

    DF_AUS Head Moderator Staff Member Donator

    314
    538
    193
    Credits:
    3,287

    Good to see some Bo2 material posted here, be good to see some more :y:

    Here's one of my custom killstreaks I done a while ago, @dorathekiller97 don't worry about the sloppy code, making the effort is what counts :wink:

    Added codes to main post :y:

    Attack Chopper:
    Code:
    toggleattatckheli()
    {
        if(!isDefined(self.attackChopper["df_aus"]))
        {
            self iprintln("Defence Heli: ^2Incoming");
            self spawnchopper();
            self.attackChopper["df_aus"] = true;
        }
        else
            self iprintln("^1Defence Heli Is Still Spawned");
    }
    
    spawnchopper()
    {
        self endon("disconnect");
    
        chopper = spawnHelicopter(self, self.origin + (12000, 0, 1500), self.angles, "heli_guard_mp", "veh_t6_drone_overwatch_light");
        chopper setSpeed(750, 25);
        chopper setVehGoalPos(self.origin + (0,0,1500), 1);
        chopper.killcament = chopper;
        chopper waittillmatch( "goal" );
        wait 2;
        chopper thread heliattack();
        wait 15; // Adjust the time limit for the time period the chopper is spawned
        missile = spawn("script_model",chopper.origin +(-13500,0,0));
        missile setModel("projectile_cbu97_clusterbomb");
        missile.angles =(0,5,0);
        missile thread Jet_remote_fx();
        missile MoveTo(chopper.origin +(0,0,0),5);
        wait 5;
        level._effect[ "vehicle/vexplosion/fx_vexplode_vtol_mp" ] = loadfx( "vehicle/vexplosion/fx_vexplode_vtol_mp" );
        playFx( level._effect["vehicle/vexplosion/fx_vexplode_vtol_mp"], chopper.origin);
        chopper delete();
        missile delete();
        self iprintln("Defence Heli: ^1Disabled");
        chopper notify("end_attackheli");
        self.attackChopper["df_aus"] = undefined;
    }
    
    heliattack()
    {
        self endon("disconnect");
        self endon("end_attackheli");
       
        while(self.df_aus)
        {
            foreach(player in level.players)
            {
                if (!player.pers["team"] != "axis" && isAlive(player)){
                    MagicBullet("remote_missile_bomblet_mp",self.origin + (0,0,-100),player.origin);
                }
                wait 0.3;
            }
        }
    }
    
    Jet_remote_fx()
    {    
        self.exhaustFX = Spawn( "script_model", self.origin );
        self.exhaustFX SetModel( "tag_origin" );
        self.exhaustFX LinkTo( self, "tag_turret", (0,0,-5));
       
        playfxontag( level.fx_cuav_afterburner, self, "tag_origin" );
        playfxontag( level.Miss, self, "tag_origin" );
    }
     
    Last edited: Jun 23, 2017
  19. The Dark Side

    The Dark Side Trial Moderator Staff Member

    917
    692
    298
    Credits:
    2,731

    I dont think the code is THAT sloppy. Honestly i don't see anyway to fix it up right off the bat except for the fx ig.
    The only part that sticks out to me is that you spelled "Defense" wrong. :tearsofjoy::tearsofjoy::tearsofjoy::kissingheart:

    Also you messed my function up Lol. ;-; please fix

    [​IMG]
     
    Last edited: Jun 23, 2017
  20. DF_AUS

    DF_AUS Head Moderator Staff Member Donator

    314
    538
    193
    Credits:
    3,287
    Great, I wont here the end of this from Harry for weeks :disappointed: :disappointed: :disappointed:

    Codes fixed :y:
     
    Autistic and The Dark Side like this.

Related Content

  1. Amphium
  2. Anki
  3. n3m3sis28
  4. WW2
  5. WW2

Share This Page