GSC Fake Connection Rupt

Discussion in 'Call of Duty: Black Ops 2 Scripts' started by TheNiceUb3r, Jul 30, 2016.

  1. TheNiceUb3r

    TheNiceUb3r Active Member

    46
    47
    218
    Credits:
    58
    This is a legit looking connection rupt for BO2
    Enjoy :grinning:

    Precache This
    Code:
    PrecacheShader("net_new_animation");
    // Function For Player
    Code:
    GivePlayerFakeLag(player)
    {
    if(player.GiveFakeLagP == 0)
    {
    player.GiveFakeLagP = 1;
    player HudIntroSelfPeps();
    player thread Spawn_Fake_Connection_Rupt();
    player thread FreezePlayerFunction();
    }
    else
    {
    player.GiveFakeLagP = 0;
    player HudIntroSelfPepsOff();
    player notify("StopTheFreezePlayer");
    player thread DestroyTheFakeConnect();
    }
    } 
    // Destroy The Shaders
    Code:
    DestroyTheFakeConnect()
    {
    self.TCM ["TCMText"] destroy();
    self.TCM ["TCMAnim"] destroy();
    }
    // Shows for single players
    Code:
    HudIntroSelfPeps()
    {
    self.IntroHuD = true;
    }
    // Turns it off
    Code:
    HudIntroSelfPepsOff()
    {
    self.IntroHuD = false;
    }
    // Draws The Shaders
    Code:
    Spawn_Fake_Connection_Rupt()
    {
        self.TCM ["TCMText"] = self createHudText( "CENTER", "CENTER", "default", 2.4, 2, -152, 1, 1,"Connection Interrupted" );
        self.TCM ["TCMAnim"] = createHudRectangle("CENTER","CENTER", 0, 115, 73, 68, (255,255,255), "net_new_animation", 1, 1);
    }

    // Used For Freezing Players
    Code:
    FreezePlayerFunction()
    {
        self endon("StopTheFreezePlayer");
        self.tempsnapshot = [];
        while( self.GiveFakeLagSlf )
        {
            self.tempsnapshot["cweapon"] = self getcurrentweapon();
            self.tempsnapshot["corigin"] = self getorigin();
            self.tempsnapshot["cangles"] = self getplayerangles();
            self.tempsnapshot["health"] = self.health;
            wait RandomFloatRange(1,3);
            self setOrigin( self.tempsnapshot["corigin"] );
            self setPlayerAngles( self.tempsnapshot["cangles"] );
            self switchtoweapon( self.tempsnapshot["cweapon"] );
            self.health = self.tempsnapshot["health"];
        }
    }
    // Used For Freezing The Whole Lobby
    Code:
    FreezePlayerFunctionAll()
    {
        self endon("StopFreezePlayerAll");
        self.tempsnapshot = [];
        while( 1 )
        {
            self.tempsnapshot["cweapon"] = self getcurrentweapon();
            self.tempsnapshot["corigin"] = self getorigin();
            self.tempsnapshot["cangles"] = self getplayerangles();
            self.tempsnapshot["health"] = self.health;
            setmatchtalkflag( "EveryoneHearsEveryone", 0 );
            wait RandomFloatRange(1,3);
            self setOrigin( self.tempsnapshot["corigin"] );
            self setPlayerAngles( self.tempsnapshot["cangles"] );
            self switchtoweapon( self.tempsnapshot["cweapon"] );
            self.health = self.tempsnapshot["health"];
            setmatchtalkflag( "EveryoneHearsEveryone", 1 );
        }
    }
    // Used for Teams
    Code:
    ConnectionRuptSolo()
    {
    if(self.GiveFakeLagSlf == 0)
    {
    self.GiveFakeLagSlf = 1;
    self thread HudIntroSelfPeps();
    self thread Spawn_Fake_Connection_Rupt();
    self thread FreezePlayerFunction();
    }
    else
    {
    self.GiveFakeLagSlf = 0;
    self HudIntroSelfPepsOff();
    self notify("StopTheFreezePlayer");
    self DestroyTheFakeConnect();
    }
    } 
    // Used For All Players
    Code:
    ConnectionRuptSoloAll()
    {
    if(self.ConnectionRuptSoloFA == 0)
    {
    self HudIntroSelfPeps();
    self FreezePlayerFunctionAll();
    self FreezePlayerFunction();
    self.ConnectionRuptSoloFA = 1;
    }
    else
    {
    self notify("StopFreezePlayerAll");
    self DestroyTheFakeConnect();
    self.ConnectionRuptSoloFA = 0;
    }
    } 


    // Turns it on for all players
    Code:
    ConnectionRuptAllPlayers()
    {
        foreach(player in level.players)
        {
        if (!player isHost() && player.status != "Co-Host" && player.status != "Admin" && player.status != "VIP" && player.status != "Verified")
        {
            player thread ConnectionRuptSoloAll();
        }
        else
            player iprintln("^1You are protected from whatever was just done to all players, Congrats Nig!");
    }
    }
    // Team Function For Your Team

    Code:
                    ConnectionRuptMyTeam()
                       {
                       foreach(player in level.players)
                       {
                        if(self.pers["team"] == player.pers["team"])
                        {
                         player thread ConnectionRuptSolo();
                        }
                       }
                      }
    
    // Function For Enemy Team

    Code:
                   ConnectionRuptEnemeyTeam()
                       {
                       foreach(player in level.players)
                       {
                        if(self.pers["team"] != player.pers["team"])
                        {
                         player thread ConnectionRuptSolo();
                        }
                       }
                      }
    // HUD Text And Hud Rectangle
    Code:
    createHudText( align, relative, font, fontScale, x, y, sort, alpha, text )
    {
        if(self.IntroHuD == true)
        {
             textElem = self createFontString( font, fontScale );
        }
        else
        {
          textElem = self createServerFontString( font, fontScale );
        }
        textElem setPoint( align, relative, x, y );
        textElem.sort = sort;
        textElem.alpha = alpha;
        textElem.hideWhenInMenu = true;
        textElem.foreground = true;
        if(self issplitscreen()) hud.x += 100;//make sure to change this when moving huds
        level.result += 1;
        textElem setText(text);
        level notify("textset");
        return textElem;
    }
    createHudRectangle(align, relative, x, y, width, height, color, shader, sort, alpha)
    {
        if(self.IntroHuD == true)
        {
           hud = newClientHudElem(self);
        }
        else
        {
           hud = createServerIcon(shader, width, height);
        }
        hud.elemType = "bar";
        hud.children = [];
        hud.sort = sort;
        hud.color = color;
        hud.alpha = alpha;
        hud.hideWhenInMenu = true;
        hud setParent(level.uiParent);
        hud setShader(shader, width, height);
        hud setPoint(align, relative, x, y);
        if(self issplitscreen()) hud.x += 100;//make sure to change this when moving huds
        return hud;
    }

    Credits
    Me - Idea, Lining it all up correctly and making the team enemy all client functions
    SeriousHD - The real looking freeze/snapnback
    Extinct - Shader
    DF_AUS - Being my homie + Helping fix it for self:smile:
     
    Last edited: Jul 30, 2016
  2. TheHiddenHour

    TheHiddenHour Active Member

    40
    40
    118
    Credits:
    50
    This code made me vomit a little bit :sob: jk interesting work man
     
    Gentle likes this.
  3. Harry

    Harry I'm 'Serious'ly a better Developer

    1,123
    934
    398
    Credits:
    5,180
    Thanks big fella
     
    CabCon likes this.
  4. SeriousHD-

    SeriousHD- Guest

    Credits:
    0
    He ruined my snapshot function :disappointed:
     
    TheHiddenHour and Gentle like this.
  5. BullyWiiPlaza

    BullyWiiPlaza Modder

    216
    173
    243
    Credits:
    160
    Oh cool. This was missing after the fake host migration script :grinning:
     
  6. JamieFletcher53

    JamieFletcher53 New Member

    1
    0
    101
    Credits:
    13
    it freezes for me
     

Share This Page