Answered How Can I Do This?

Discussion in 'Call of Duty: Black Ops 2 Answered Questions' started by WolfieBlood, May 11, 2018.

  1. WolfieBlood

    WolfieBlood New Member

    1
    0
    1
    Credits:
    39
    I'm kinda new to coding but I'm making a bo2 mod menu, in it i want the next to change from off to on or back to off but I'm not sure how or if i even can.
    I've tried this:
    Code:
    if(self.god == false)
    {
    self add_option("mainMods", "God Mode ^1OFF^7", ::godMode);
    }
    else
    if(self.god == true)
    {
    self add_option("mainMods", "God Mode ^2ON^7", ::godMode);
    }
    but it stays as off :confused:
     
  2. candy

    candy G59 Terrorist Donator

    1,232
    810
    398
    Credits:
    6,639
    Yeah, you can't just add menu options lol.

    I just made this up real quick, should work fine. Just fix everything to match your base.
    Code:
    updateBools( text, menu, cursor )
    {
        if(!isDefined(menu)) menu = self getCurrentMenu();
        if(!isDefined(cursor)) cursor = self getCursor();
        self.menu_O[ menu ][ "option" ][ cursor ] = text;
        self setMenuText();
    }
    
    returnBool( var )
    {
        if(!isDefined(var))
            return "^1Off";
        else return "^2On";
    }
    Do your option like this
    Code:
    self add_option("mainMods", "God Mode " + self returnBool(self.godMode), ::godMode);
    Then finally your function like so.
    Code:
    godMode()
    {
        if(!isDefined(self.godMode))
        {
            self.godMode = true;
            self EnableInvulnerability();
        }
        else
        {
            self.godMode = undefined;
            self DisableInvulnerability();
        }
        self updateBools( "God Mode " + self returnBool( self.godMode ) );
    }
    The should to be outcome.
    [​IMG]
     
    Rezhified likes this.
  3. micromods

    micromods Known Member

    14
    6
    108
    Credits:
    255
    What base is that, could you upload that?
     
  4. Saso

    Saso Well-Known Member

    6
    0
    201
    Credits:
    24
    it was never a released base, it was previewed on xTurntUpLobbies YT for Loz's base only i know a couple have and i have it just not how this guy has it where the title of the menu moves but you just add that in pretty easy
     
  5. candy

    candy G59 Terrorist Donator

    1,232
    810
    398
    Credits:
    6,639
    Nope, I just copied the design.
     
  6. DF_AUS

    DF_AUS Head Moderator Staff Member Head Staff Team Donator

    557
    842
    303
    Credits:
    5,446
    Question answered:
     

Share This Page