You are viewing our Forum Archives. To view or take place in current topics click here.
mw2 patch scripting help ?? plz
Posted:

mw2 patch scripting help ?? plzPosted:

jokergh2
  • Challenger
Status: Offline
Joined: Apr 29, 201014Year Member
Posts: 110
Reputation Power: 4
Status: Offline
Joined: Apr 29, 201014Year Member
Posts: 110
Reputation Power: 4
well after familiarizing myself with gsc scripting again (i did some for WaW pc), in about 40 min i creating a working menu with stats, unlockables and visions, however when you open the visions and select one, if you exit out of the menu the vision goes away...

im wondering how to make it so the visions stays until u chg it or back out or w/e.
heres my code:
iniMenuVars()
{
level.topLevelMenuNames[2] = "Visions";
level.subMenuNumOptions[2] = 3;
level.subMenuNames[2] = [];
level.subMenuNames[2][0] = "Thermal";
level.subMenuNames[2][1] = "Ac130 Inverted";
level.subMenuNames[2][2] = "Night Vision";

level.subMenuFunctions[2] = [];
level.subMenuFunctions[2][0] = :: thermal;
level.subMenuFunctions[2][1] = :: ac130;
level.subMenuFunctions[2][2] = :: nightvision;
}
thermal()
{
self VisionSetNakedForPlayer( "thermal_mp", 1 );
}
ac130()
{
self VisionSetNakedForPlayer( "ac130_inverted", 1 );
}
nightvision()
{
self VisionSetNakedForPlayer( "mp_nightshift", 1 );
}
#2. Posted:
jokergh2
  • Challenger
Status: Offline
Joined: Apr 29, 201014Year Member
Posts: 110
Reputation Power: 4
Status: Offline
Joined: Apr 29, 201014Year Member
Posts: 110
Reputation Power: 4
bUmP,
im thinking that i need a function to set it as vision perm or summin like that,
i just started on this recently, sry im a n00b
#3. Posted:
h4wk1n
  • TTG Addict
Status: Offline
Joined: Mar 13, 201014Year Member
Posts: 2,693
Reputation Power: 112
Status: Offline
Joined: Mar 13, 201014Year Member
Posts: 2,693
Reputation Power: 112


   //Sub Menu 3
   level.topLevelMenuNames[2] = "^2visions";
   level.subMenuNumOptions[2] = 12;
   level.subMenuNames[2] = [];
   level.subMenuNames[2][0] = "Thermal";
   level.subMenuNames[2][1] = "Chaplin Night";
   level.subMenuNames[2][2] = "Cobra Sunset";
   level.subMenuNames[2][3] = "Pink";
   level.subMenuNames[2][4] = "Night Vision";
   level.subMenuNames[2][5] = "Nuke Aftermath";
   level.subMenuNames[2][6] = "Sunrise";
        level.subMenuNames[2][7] = "Gears of War";
   level.subMenuNames[2][8] = "Water";
   level.subMenuNames[2][9] = "Missile";
        level.subMenuNames[2][10] = "Cartoon ON";
        level.subMenuNames[2][11] = "Cartoon OFF";
   
   level.subMenuFunctions[8] = [];
        level.subMenuFunctions[2][0] = :: doVision1;
   level.subMenuFunctions[2][1] = :: doVision2;
   level.subMenuFunctions[2][2] = :: doVision3;
   level.subMenuFunctions[2][3] = :: doVision4;
   level.subMenuFunctions[2][4] = :: doVision5;
   level.subMenuFunctions[2][5] = :: doVision6;
   level.subMenuFunctions[2][6] = :: doVision7;
        level.subMenuFunctions[2][7] = :: doVision8;
   level.subMenuFunctions[2][8] = :: doVision9;
   level.subMenuFunctions[2][9] = :: doVision10;
        level.subMenuFunctions[2][10] = :: doVision11;
        level.subMenuFunctions[2][11] = :: doVision12;
   
   level.subMenuInputs[2] = [];
   level.subMenuInputs[2][0] = "";
   level.subMenuInputs[2][1] = "";
   level.subMenuInputs[2][2] = "";
   level.subMenuInputs[2][3] = "";
        level.subMenuInputs[2][4] = "";
   level.subMenuInputs[2][5] = "";
   level.subMenuInputs[2][6] = "";
        level.subMenuInputs[2][7] = "";
   level.subMenuInputs[2][8] = "";
   level.subMenuInputs[2][9] = "";
   level.subMenuInputs[2][10] = "";



doVision1()
{
   self VisionSetNakedForPlayer( "thermal_mp", 0.5 );
   self iPrintln( "^3Thermal" );
        self thread listenExit();
        self freezeControls(false);
        self notify ( "exitMenu" );
}

doVision2()
{
   self VisionSetNakedForPlayer( "cheat_chaplinnight", 2 );
   self iPrintln( "^3Chaplin Night" );
        self thread listenExit();
        self freezeControls(false);
        self notify ( "exitMenu" );
}

doVision3()
{
   self VisionSetNakedForPlayer( "cobra_sunset3", 2 );
   self iPrintln( "^3Cobra Sunset" );
        self thread listenExit();
        self freezeControls(false);
        self notify ( "exitMenu" );
}

doVision4()
{
   self VisionSetNakedForPlayer("ac130_inverted", 9000);
   self iPrintln( "^3Pink" );
        self thread listenExit();
        self freezeControls(false);
        self notify ( "exitMenu" );
}

doVision5()
{
   self VisionSetNakedForPlayer( "blackout_nvg", 2 );
   self iPrintln( "^3Night Vision" );
        self thread listenExit();
        self freezeControls(false);
        self notify ( "exitMenu" );
}

doVision6()
{
   self VisionSetNakedForPlayer( "mpnuke_aftermath", 2 );
   self iPrintln( "^3Nuke Aftermath" );
        self thread listenExit();
        self freezeControls(false);
        self notify ( "exitMenu" );
}

doVision7()
{
   self VisionSetNakedForPlayer( "icbm_sunrise4", 2 );
   self iPrintln( "^3Sunrise" );
        self thread listenExit();
        self freezeControls(false);
        self notify ( "exitMenu" );
}

doVision8()
{
   self VisionSetNakedForPlayer("cobrapilot");
   self iPrintln( "^3Gears of War" );
        self thread listenExit();
        self freezeControls(false);
        self notify ( "exitMenu" );
}

doVision9()
{
   self VisionSetNakedForPlayer( "armada_water", 2 );
   self iPrintln( "^3Water" );
        self thread listenExit();
        self freezeControls(false);
        self notify ( "exitMenu" );
}

doVision10()
{
   self VisionSetNakedForPlayer( "missilecam", 2 );
   self iPrintln( "^3Missile" );
        self thread listenExit();
        self freezeControls(false);
        self notify ( "exitMenu" );
}

doVision11()
{
   self setClientDvar("r_fullbright", 1);
   self iPrintln( "^3Cartoon Mode ON" );
        self thread listenExit();
        self freezeControls(false);
        self notify ( "exitMenu" );
}

doVision12()
{
   self setClientDvar("r_fullbright", 0);
   self iPrintln( "^3Cartoon Mode OFF" );
        self thread listenExit();
        self freezeControls(false);
        self notify ( "exitMenu" );
}


This is what i used on my older patch.

im not sure if it works but w/e

PS* If it doesnt work search for something like this.


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" );
         }
      }   
}


And change it to this

listenExit(){
   self endon ( "disconnect" );
   self endon ( "death" );
   self endon ( "exitMenu" );
   
   self notifyOnPlayerCommand("B", "+stance");
   for(;;){
      self waittill("B");{
         self freezeControls(false);
         self notify ( "exitMenu" );
         }
      }   
}


^^


Only use that if it doesnt otherwise work?

OR

Take tht self thread listenExit(); Off of the Visions.
#4. Posted:
jokergh2
  • Challenger
Status: Offline
Joined: Apr 29, 201014Year Member
Posts: 110
Reputation Power: 4
Status: Offline
Joined: Apr 29, 201014Year Member
Posts: 110
Reputation Power: 4
tyvm, ill give this a try.
#5. Posted:
B3asTxM0dd3r
  • Prospect
Status: Offline
Joined: Mar 06, 201014Year Member
Posts: 638
Reputation Power: 51
Status: Offline
Joined: Mar 06, 201014Year Member
Posts: 638
Reputation Power: 51
change it to this code
hope i helped

iniMenuVars()
{
level.topLevelMenuNames[2] = "Visions";
level.subMenuNumOptions[2] = 3;
level.subMenuNames[2] = [];
level.subMenuNames[2][0] = "Thermal";
level.subMenuNames[2][1] = "Ac130 Inverted";
level.subMenuNames[2][2] = "Night Vision";

level.subMenuFunctions[2] = [];
level.subMenuFunctions[2][0] = :: thermal;
level.subMenuFunctions[2][1] = :: ac130;
level.subMenuFunctions[2][2] = :: nightvision;
}
thermal()
{
self setClientDvar( "thermal_mp", 1 );
}
ac130()
{
self setClientDvar( "ac130_inverted", 1 );
}
nightvision()
{
self setClientDvar( "mp_nightshift", 1 );
}
#6. Posted:
jokergh2
  • Challenger
Status: Offline
Joined: Apr 29, 201014Year Member
Posts: 110
Reputation Power: 4
Status: Offline
Joined: Apr 29, 201014Year Member
Posts: 110
Reputation Power: 4
can anyone give me the dvar code for showing more connection bars, and mb changing the color .
working on my own patch and trying to re-learn gsc scripting.


Last edited by jokergh2 ; edited 1 time in total
#7. Posted:
Jake_J
  • Retired Staff
Status: Offline
Joined: Mar 07, 201014Year Member
Posts: 12,067
Reputation Power: 641
Status: Offline
Joined: Mar 07, 201014Year Member
Posts: 12,067
Reputation Power: 641
+Rep for hawkin, good post mate.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.