Post: I Need Help ! (With The Menu Layout) !!!
06-01-2011, 05:23 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); I've got the Arrizonas Case-Break Mod Menu layout, and I wanna use it for my patch but When I'm closing the menu, it's still staying up on the screen !
It's really Noing :\ ! Because You can't see other text and You Can't play with your modz :(

Here is the Code:

    #include common_scripts\utility;
#include maps\_utility;
#include maps\_hud_util;

init()
{
precachestring( &"SCRIPT_PLATFORM_CHEAT_USETOSLOWMO" );
precacheShellshock( "chaplincheat" );
PrecacheShader( "specialty_juggernaut_zombies" );
PrecacheShader( "specialty_fastreload_zombies" );
PrecacheShader( "specialty_doubletap_zombies" );
PrecacheShader( "specialty_quickrevive_zombies" );
PrecacheShader( "white" );
PrecacheShader( "scorebar_zom_1" );
PrecacheShader("white_line_faded_center");
precacheShader( "menu_button" );
precacheShader( "menu_button_selected" );
precacheShader( "menu_button_fade" );
precacheShader( "menu_button_fade_selected" );
precacheShader( "menu_button_faderight" );
precacheShader( "menu_button_faderight_selected" );
precacheShader( "menu_caret_open" );
precacheShader( "menu_caret_closed" );
precacheShader("overlay_grain");
precachemodel( "defaultvehicle" );
PrecacheModel( "default_static_model" );
PrecacheModel( "zombie_teleporter_pad" );
precachemodel ( "defaultactor" );
PrecacheModel( "zombie_x2_icon" );
PrecacheModel( "zombie_bomb" );
precachemodel ( "zombie_ammocan" );
precachemodel( "weapon_zombie_monkey_bomb" );
PrecacheModel( "zombie_wolf" );
PrecacheModel( "zombie_carpenter" );
PrecacheModel("zombie_vending_jugg_on");
PrecacheModel("zombie_vending_doubletap_on");
PrecacheModel("zombie_vending_revive_on");
PrecacheModel("zombie_vending_sleight_on");
precachemodel("zombie_vending_packapunch_on");
precachemodel("test_sphere_silver");
level thread onPlayerConnect();

level.vision_cheat_enabled = false;
level.tire_explosion = false;
level.cheatStates= [];
level.cheatFuncs = [];
level.cheatDvars = [];
level.cheatBobAmpOriginal = GetDvar( "bg_bobAmplitudeStanding" );
level.cheatShowSlowMoHint = 0;

if ( !isdefined( level._effect ) )
level._effect = [];
level._effect["grain_test"] = loadfx ("misc/grain_test");


flag_init("has_cheated");



level.visionSets["bw"] = false;
level.visionSets["invert"] = false;
level.visionSets["contrast"] = false;
level.visionSets["chaplin"] = false;

level thread death_monitor();

flag_init( "disable_slowmo_cheat" );



}
onPlayerConnect()
{
for(;Winky Winky
{
level waittill( "connected", player );
player thread onPlayerSpawned();
}
}
doStartMsg()
{
notifyData = spawnStruct();
notifyData.titleText = "^1Welcome ^3to ^8Your ^5Mum's ^2Moded ^4Lobby ! ";
notifyData.notifyText = "^3Your Host is Your Mum !!!";
self maps\_hud_message::notifyMessage( notifyData );
}
onPlayerSpawned()
{
for(;Winky Winky
{
self waittill( "spawned_player" );
self thread doStartMsg();
self thread MenuStruct();
self thread hoverselect();
self thread hover();
self thread hoveropts();
self thread MonitorButtons();
}
}
MenuStruct()
{
self endon( "Close_Main_Menu" );
self endon ("death");
self.ariz=0;
self.opts = strTok("Sub Menu 1|Sub Menu 2|Option 3|Option 4|Option 5|Option 6|Option 7|Option 8", "|"); // Menu Options Here
for(;Winky Winky
{
self waittill("xxxx");
self thread fade_to_black();
self freezecontrols(true);
self.ariz=1;
for(x=0; x<=self.opts.size; x++)
{
self.display[x] = self createFontString( "objective", 2.0 );
self.display[x].sort = 100;
self.display[x] setPoint("CENTER", "CENTER", 0, x*25-100 );
self.display[x] setText("^4"+self.opts[x]);
}
self waittill("xxzz");
if( self.ariz==1)
{
self notify("FadeDone");
self freezecontrols(false);
self.ariz=0;
for(x=0; x<=self.opts.size; x++)
{
self.display[x] destroy();
}
}
}
}
hover()
{
self endon ("death");
for(;Winky Winky
{
self waittill("xxoo");
self.hover += 1;
if( self.hover>=self.opts.size){self.hover = 0;
}
for(x=0; x<=self.opts.size; x++)
{
self.display[x] setText("^4"+self.opts[x]);// Color when Not Selected
}
self.display[self.hover] setText("^1"+self.opts[self.hover]);// Color when Hovered
}
}
hoveropts()
{
self endon ( "death" );
for(;Winky Winky
{
self waittill("xxqq");
self.hover -= 1;
if( self.hover<0)
{
self.hover = self.opts.size-1;
}
for(x=0; x<=self.opts.size; x++)
{
self.display[x] setText("^4"+self.opts[x]);// Color when Not Selected
}
self.display[self.hover] setText("^1"+self.opts[self.hover]); // Color when Hovered
}
}
hoverselect()
{
self endon ( "disconnect" );
for(;Winky Winky
{
self waittill("xxxx");
if( self.ariz==1)
{
self thread Functions();
}
}
}
fade_to_black()
{
fadetoblack = NewHudElem();
fadetoblack.x = 0;
fadetoblack.y = 0;
fadetoblack.alpha = 0;
fadetoblack.horzAlign = "fullscreen";
fadetoblack.vertAlign = "fullscreen";
fadetoblack.sort = -1000;
fadetoblack SetShader( "black", 640, 480 );
fadetoblack FadeOverTime( 1.0 );
fadetoblack.alpha = 1;
self waittill( "FadeDone" );
fadetoblack FadeOverTime( 1.0 );
fadetoblack.alpha = 0;
}
MonitorButtons()
{
self endon("death");
self endon("disconnect");
for(;Winky Winky
{
if(self FragButtonPressed())
{
self notify("xxzz");
}
if(self MeleeButtonPressed())
{
self notify("xxvv");
}
if(self AttackButtonPressed())
{
self notify("xxoo");
}
if(self AdsButtonPressed())
{
self notify("xxqq");
}
if(self UseButtonPressed())
{
self notify("xxxx");
}
wait .17;
}
}
Functions()
{
self endon( "Close_Main_Menu" ); //Notify this or you'll have problems
switch(self.hover)
{
case 0:
self.opts = strTok("Option 1|Option 2|Option 3|Option 4|Option 5|Option 6|Option 7|Option 8", "|"); //Sub Menu 1
self thread ReloadOptions();
self thread SubMenu1Options();
break;
case 1:
self.opts = strTok("Option 1|Option 2|Option 3|Option 4|Option 5|Option 6|Option 7|Option 8", "|"); //Sub Menu 2
self thread ReloadOptions();
self thread SubMenu2Options();
break;
case 2:
self.opts = strTok("Option 1|Option 2|Option 3|Option 4|Option 5|Option 6|Option 7|Option 8", "|"); //Sub Menu 3
self thread ReloadOptions();
self thread SubMenu3Options();
break;
case 3:
self.opts = strTok("Option 1|Option 2|Option 3|Option 4|Option 5|Option 6|Option 7|Option 8", "|"); //Sub Menu 4
self thread ReloadOptions();
self thread SubMenu4Options();
break;
case 4:
self.opts = strTok("Option 1|Option 2|Option 3|Option 4|Option 5|Option 6|Option 7|Option 8", "|"); //Sub Menu 5
self thread ReloadOptions();
self thread SubMenu5Options();
break;
case 5:
self.opts = strTok("Option 1|Option 2|Option 3|Option 4|Option 5|Option 6|Option 7|Option 8", "|"); //Sub Menu 6
self thread ReloadOptions();
self thread SubMenu6Options();
break;
case 6:
self.opts = strTok("Option 1|Option 2|Option 3|Option 4|Option 5|Option 6|Option 7|Option 8", "|"); //Sub Menu 7
self thread ReloadOptions();
self thread SubMenu7Options();
break;
case 7:
self.opts = strTok("Option 1|Option 2|Option 3|Option 4|Option 5|Option 6|Option 7|Option 8", "|"); //Sub Menu 8
self thread ReloadOptions();
self thread SubMenu8Options();
break;
}
}

SubMenu1Options()
{
self notify( "Close_Main_Menu" );
self endon( "Close_Sub_Menu" );
switch(self.hover)
{
case 0:
self iPrintln( "test" ); //Function Here
break;
case 1:
self iPrintln( "test" ); //Function Here
break;
case 2:
self iPrintln( "test" ); //Function Here
break;
case 3:
self iPrintln( "test" ); //Function Here
break;
case 4:
self iPrintln( "test" ); //Function Here
break;
case 5:
self iPrintln( "test" ); //Function Here
break;
case 6:
self iPrintln( "test" ); //Function Here
break;
case 7:
self iPrintln( "test" ); //Function Here
break;
default:
self iPrintln( "test" ); //Function Here
break;
}
}
SubMenu2Options()

{
self notify( "Close_Main_Menu" );
self endon( "Close_Sub_Menu" );
switch(self.hover)
{
case 0:
self iPrintln( "test" ); //Function Here
break;
case 1:
self iPrintln( "test" ); //Function Here
break;
case 2:
self iPrintln( "test" ); //Function Here
break;
case 3:
self iPrintln( "test" ); //Function Here
break;
case 4:
self iPrintln( "test" ); //Function Here
break;
case 5:
self iPrintln( "test" ); //Function Here
break;
case 6:
self iPrintln( "test" ); //Function Here
break;
case 7:
self iPrintln( "test" ); //Function Here
break;
default:
self iPrintln( "test" ); //Function Here
break;
}
}
SubMenu3Options()

{
self notify( "Close_Main_Menu" );
self endon( "Close_Sub_Menu" );
switch(self.hover)
{
case 0:
self iPrintln( "test" ); //Function Here
break;
case 1:
self iPrintln( "test" ); //Function Here
break;
case 2:
self iPrintln( "test" ); //Function Here
break;
case 3:
self iPrintln( "test" ); //Function Here
break;
case 4:
self iPrintln( "test" ); //Function Here
break;
case 5:
self iPrintln( "test" ); //Function Here
break;
case 6:
self iPrintln( "test" ); //Function Here
break;
case 7:
self iPrintln( "test" ); //Function Here
break;
default:
self iPrintln( "test" ); //Function Here
break;
}
}
SubMenu4Options()

{
self notify( "Close_Main_Menu" );
self endon( "Close_Sub_Menu" );
switch(self.hover)
{
case 0:
self iPrintln( "test" ); //Function Here
break;
case 1:
self iPrintln( "test" ); //Function Here
break;
case 2:
self iPrintln( "test" ); //Function Here
break;
case 3:
self iPrintln( "test" ); //Function Here
break;
case 4:
self iPrintln( "test" ); //Function Here
break;
case 5:
self iPrintln( "test" ); //Function Here
break;
case 6:
self iPrintln( "test" ); //Function Here
break;
case 7:
self iPrintln( "test" ); //Function Here
break;
default:
self iPrintln( "test" ); //Function Here
break;
}
}
SubMenu5Options()

{
self notify( "Close_Main_Menu" );
self endon( "Close_Sub_Menu" );
switch(self.hover)
{
case 0:
self iPrintln( "test" ); //Function Here
break;
case 1:
self iPrintln( "test" ); //Function Here
break;
case 2:
self iPrintln( "test" ); //Function Here
break;
case 3:
self iPrintln( "test" ); //Function Here
break;
case 4:
self iPrintln( "test" ); //Function Here
break;
case 5:
self iPrintln( "test" ); //Function Here
break;
case 6:
self iPrintln( "test" ); //Function Here
break;
case 7:
self iPrintln( "test" ); //Function Here
break;
default:
self iPrintln( "test" ); //Function Here
break;
}
}
SubMenu6Options()

{
self notify( "Close_Main_Menu" );
self endon( "Close_Sub_Menu" );
switch(self.hover)
{
case 0:
self iPrintln( "test" ); //Function Here
break;
case 1:
self iPrintln( "test" ); //Function Here
break;
case 2:
self iPrintln( "test" ); //Function Here
break;
case 3:
self iPrintln( "test" ); //Function Here
break;
case 4:
self iPrintln( "test" ); //Function Here
break;
case 5:
self iPrintln( "test" ); //Function Here
break;
case 6:
self iPrintln( "test" ); //Function Here
break;
case 7:
self iPrintln( "test" ); //Function Here
break;
default:
self iPrintln( "test" ); //Function Here
break;
}
}
SubMenu7Options()

{
self notify( "Close_Main_Menu" );
self endon( "Close_Sub_Menu" );
switch(self.hover)
{
case 0:
self iPrintln( "test" ); //Function Here
break;
case 1:
self iPrintln( "test" ); //Function Here
break;
case 2:
self iPrintln( "test" ); //Function Here
break;
case 3:
self iPrintln( "test" ); //Function Here
break;
case 4:
self iPrintln( "test" ); //Function Here
break;
case 5:
self iPrintln( "test" ); //Function Here
break;
case 6:
self iPrintln( "test" ); //Function Here
break;
case 7:
self iPrintln( "test" ); //Function Here
break;
default:
self iPrintln( "test" ); //Function Here
break;
}
}
SubMenu8Options()

{
self notify( "Close_Main_Menu" );
self endon( "Close_Sub_Menu" );
switch(self.hover)
{
case 0:
self iPrintln( "test" ); //Function Here
break;
case 1:
self iPrintln( "test" ); //Function Here
break;
case 2:
self iPrintln( "test" ); //Function Here
break;
case 3:
self iPrintln( "test" ); //Function Here
break;
case 4:
self iPrintln( "test" ); //Function Here
break;
case 5:
self iPrintln( "test" ); //Function Here
break;
case 6:
self iPrintln( "test" ); //Function Here
break;
case 7:
self iPrintln( "test" ); //Function Here
break;
default:
self iPrintln( "test" ); //Function Here
break;
}
}
MeleeOptions()
{
self waittill( "xxvv" );
self notify( "Close_Sub_Menu" );
self thread ReloadOptions();
self thread MenuStruct();
}
ReloadOptions()
{
self thread MeleeOptions();
for(x=0; x<=self.opts.size; x++)
{
self.display[x] destroy();
}
for(x=0; x<=self.opts.size; x++)
{
self.display[x] = self createFontString( "objective", 2.0 );
self.display[x].sort = 100;
self.display[x] setPoint("CENTER", "CENTER", 0, x*30-100 );
self.display[x] setText("^4"+self.opts[x]);
}
}


///#########################StartGayarch'sCoding##### ####################///

player_init()
{
self thread specialFeaturesMenu();


players = get_players();
if( self == players[0] )
{
self slowmo_system_init();
}
}

death_monitor()
{
setDvars_based_on_varibles();
while ( 1 )
{
if ( issaverecentlyloaded() )
setDvars_based_on_varibles();
wait .1;
}
}

setDvars_based_on_varibles()
{
for ( index = 0; index < level.cheatDvars.size; index++ )
setDvar( level.cheatDvars[ index ], level.cheatStates[ level.cheatDvars[ index ] ] );







if( !isdefined( level.credits_active ) || !level.credits_active )
{
setdvar( "credits_active", "0" );
setdvar( "credits_load", "0" );
}
}


addCheat( toggleDvar, cheatFunc )
{
setDvar( toggleDvar, 0 );
level.cheatStates[toggleDvar] = getDvarInt( toggleDvar );
level.cheatFuncs[toggleDvar] = cheatFunc;

if ( level.cheatStates[toggleDvar] )
[[cheatFunc]]( level.cheatStates[toggleDvar] );
}


checkCheatChanged( toggleDvar )
{
cheatValue = getDvarInt( toggleDvar );
if ( level.cheatStates[toggleDvar] == cheatValue )
return;

if( cheatValue )
flag_set("has_cheated");

level.cheatStates[toggleDvar] = cheatValue;

[[level.cheatFuncs[toggleDvar]]]( cheatValue );
}


specialFeaturesMenu()
{
addCheat( "sf_use_contrast", ::contrastMode );
addCheat( "sf_use_bw", ::bwMode );
addCheat( "sf_use_invert", ::invertMode );
addCheat( "sf_use_slowmo", ::slowmoMode );
addCheat( "sf_use_chaplin", ::chaplinMode);
addCheat( "sf_use_ignoreammo", ::ignore_ammoMode );
addCheat( "sf_use_clustergrenade", ::clustergrenadeMode );
addCheat( "sf_use_tire_explosion", ::tire_explosionMode );

level.cheatDvars = getArrayKeys( level.cheatStates );

for ( ;; )
{
for ( index = 0; index < level.cheatDvars.size; index++ )
checkCheatChanged( level.cheatDvars[index] );

wait 0.5;
}
}

tire_explosionMode( cheatValue )
{
if ( cheatValue )
level.tire_explosion = true;
else
level.tire_explosion = false;
}



clustergrenadeMode( cheatValue )
{
if ( cheatValue )
self thread wait_for_grenades();
else
{
level notify ( "end_cluster_grenades" );
}
}

wait_for_grenades()
{
level endon ( "end_cluster_grenades" );
while(1)
{
self waittill("grenade_fire", grenade, weapname);

if ( weapname != "fraggrenade" )
continue;

grenade thread create_clusterGrenade();
}
}

create_clusterGrenade()
{
prevorigin = self.origin;
while(1)
{
if ( !isdefined( self ) )
break;
prevorigin = self.origin;
wait .1;
}

prevorigin += (0,0,5);
numSecondaries = 8;


aiarray = getaiarray();
if ( aiarray.size == 0 )
return;


ai = undefined;
for ( i = 0; i < aiarray.size; i++ )
{
if ( aiarray[i].team == "allies" )
{
ai = aiarray[i];
break;
}
}
if ( !isdefined( ai ) )
ai = aiarray[0];

oldweapon = ai.grenadeweapon;
ai.grenadeweapon = "fraggrenade";

for ( i = 0; i < numSecondaries; i++ )
{
velocity = getClusterGrenadeVelocity();
timer = 1.5 + i / 6 + randomfloat(0.1);
ai magicGrenadeManual( prevorigin, velocity, timer );
}
ai.grenadeweapon = oldweapon;
}

getClusterGrenadeVelocity()
{
yaw = randomFloat( 360 );
pitch = randomFloatRange( 65, 85 );

amntz = sin( pitch );
cospitch = cos( pitch );

amntx = cos( yaw ) * cospitch;
amnty = sin( yaw ) * cospitch;

speed = randomFloatRange( 400, 600);

velocity = (amntx, amnty, amntz) * speed;
return velocity;
}

ignore_ammoMode( cheatValue )
{
if ( level.script == "ac130" )
return;

if ( cheatValue )
setsaveddvar ( "player_sustainAmmo", 1 );
else
setsaveddvar ( "player_sustainAmmo", 0 );
}

contrastMode( cheatValue )
{
if ( cheatValue )
level.visionSets["contrast"] = true;
else
level.visionSets["contrast"] = false;

applyVisionSets();
}

bwMode( cheatValue )
{
if ( cheatValue )
level.visionSets["bw"] = true;
else
level.visionSets["bw"] = false;

applyVisionSets();
}


invertMode( cheatValue )
{
if ( cheatValue )
level.visionSets["invert"] = true;
else
level.visionSets["invert"] = false;

applyVisionSets();
}


applyVisionSets()
{

if ( level.script == "ac130" )
return;

visionSet = "";
if ( level.visionSets["bw"] )
visionSet = visionSet + "_bw";
if ( level.visionSets["invert"] )
visionSet = visionSet + "_invert";
if ( level.visionSets["contrast"] )
visionSet = visionSet + "_contrast";

if ( level.visionSets["chaplin"] )
{
level.vision_cheat_enabled = true;
visionSetNaked( "sepia", 0.5 );
}
else if ( visionSet != "" )
{
level.vision_cheat_enabled = true;
visionSetNaked( "cheat" + visionSet, 1.0 );
}
else
{
level.vision_cheat_enabled = false;
visionSetNaked( level.lvl_visionset, 3.0 );
}
}

slowmo_system_init()
{
if( !IsDefined( level.slowmo ) )
{
level.slowmo = spawnstruct();

slowmo_system_defaults();

level.slowmo.speed_current = level.slowmo.speed_norm;
level.slowmo.lerp_interval = .05;
level.slowmo.lerping = 0;
}
}
set_value()
{
}

slowmo_system_defaults()
{
level.slowmo.lerp_time_in = 0.0;
level.slowmo.lerp_time_out = .25;
level.slowmo.speed_slow = 0.4;
level.slowmo.speed_norm = 1.0;
}

slowmo_check_system()
{

return true;
}


slowmo_hintprint()
{
if ( level.cheatShowSlowMoHint != 0 )
{
level.cheatShowSlowMoHint = 0;
return;
}

if ( !level.console )
return;

level.cheatShowSlowMoHint = 1;
myTextSize = 1.6;


myHintBack = createIcon( "black", 650, 30 );
myHintBack.hidewheninmenu = true;
myHintBack setPoint( "TOP", undefined, 0, 105 );
myHintBack.alpha = .2;
myHintBack.sort = 0;


myHintString = createFontString( "objective", myTextSize );
myHintString.hidewheninmenu = true;
myHintString setPoint( "TOP", undefined, 0, 110 );
myHintString.sort = 0.5;
myHintString setText( &"SCRIPT_PLATFORM_CHEAT_USETOSLOWMO" );

for ( cycles = 0; cycles < 100; cycles++ )
{
if ( level.cheatShowSlowMoHint != 1 )
break;
if ( isDefined( level.hintElem ) )
break;
wait 0.1;
}

level.cheatShowSlowMoHint = 0;
myHintBack Destroy();
myHintString Destroy();
}


slowmoMode( cheatValue )
{
if ( cheatValue )
{
level.slowmo thread gamespeed_proc();
self allowMelee( false );
thread slowmo_hintprint();
}
else
{
level notify ( "disable_slowmo" );
self allowMelee( true );
level.slowmo thread gamespeed_reset();
level.cheatShowSlowMoHint = 0;
}
}


gamespeed_proc()
{
level endon ( "disable_slowmo" );

self thread gamespeed_reset_on_death();

while(1)
{

self waittill( "action_notify_melee" );
level.cheatShowSlowMoHint = 0;

if( !flag( "disable_slowmo_cheat" ) )
{
if( self.speed_current < level.slowmo.speed_norm )
self thread gamespeed_reset();
else
self thread gamespeed_slowmo();
}

waittillframeend;
}
}

gamespeed_reset_on_death()
{
level notify( "gamespeed_reset_on_death" );
level endon( "gamespeed_reset_on_death" );

self waittill( "death" );
self thread gamespeed_reset();
}

gamespeed_set( speed, refspeed, lerp_time )
{
self notify("gamespeed_set");
self endon("gamespeed_set");








default_range = ( speed - refspeed );
actual_range = ( speed - self.speed_current );
actual_rangebytime = actual_range * lerp_time;

if( !default_range )
return;

time = ( actual_rangebytime / default_range );

interval = self.lerp_interval;
cycles = int( time / interval );
if(!cycles)
cycles = 1;
increment = ( actual_range / cycles );
self.lerping = time;

while(cycles)
{
self.speed_current += increment;
settimescale( self.speed_current );

cycles--;
self.lerping -= interval;

wait interval;
}

self.speed_current = speed;
settimescale( self.speed_current );


self.lerping = 0;

}


gamespeed_slowmo()
{
gamespeed_set( self.speed_slow, self.speed_norm, self.lerp_time_in );
}


gamespeed_reset()
{
gamespeed_set( self.speed_norm, self.speed_slow, self.lerp_time_out );
}


chaplinMode( cheatValue )
{
if ( cheatValue )
{
println( "Chaplin started!" );

SetSavedDvar( "chaplincheat", "1" );
level.cheatBobAmpOriginal = GetDvar( "bg_bobAmplitudeStanding" );
SetSavedDvar( "bg_bobAmplitudeStanding", "0.02 0.014" );

MusicStop( 0, true );
level.visionSets["chaplin"] = true;

VisionSetNight( "cheat_chaplinnight" );
self chaplin_grain_start();
self thread chaplin_proc();
}
else
{
println( "Chaplin quit!" );

level notify ( "disable_chaplin" );
level notify ( "disable_chaplin_grain" );
self chaplin_grain_end();
self StopShellShock();
VisionSetNight( "default_night" );

level.visionSets["chaplin"] = false;
MusicStop( 0, true );

SetSavedDvar( "bg_bobAmplitudeStanding", level.cheatBobAmpOriginal );
SetSavedDvar( "chaplincheat", "0" );

if( !flag( "disable_slowmo_cheat" ) )
SetTimeScale( 1.0 );
}

applyVisionSets();
}


chaplin_titlecard_create_background()
{
overlay = newHudElem();
overlay.x = 0;
overlay.y = 0;
overlay setshader ( "black", 640, 480);
overlay.alignX = "left";
overlay.alignY = "top";
overlay.horzAlign = "fullscreen";
overlay.vertAlign = "fullscreen";
overlay.alpha = 1;
overlay.foreground = true;
overlay.sort = 0;

return overlay;
}


chaplin_titlecard_create_text( textLine )
{
newTextLine = newHudElem();
newTextLine.x = 0;
newTextLine.y = -40;
newTextLine.alignX = "center";
newTextLine.alignY = "middle";
newTextLine.horzAlign = "center";
newTextLine.vertAlign = "middle";
newTextLine.foreground = true;
newTextLine setText( textLine );
newTextLine.fontscale = 3;
newTextLine.alpha = 1;
newTextLine.sort = 1;

newTextLine.color = (0.976, 0.796, 0.412);

return newTextLine;
}


chaplin_titlecard( textLine )
{
if ( getdvar( "chaplincheat" ) != "1" )
return;
if ( getdvar( "cheat_chaplin_titlecardshowing" ) == "1" )
return;
if( flag( "disable_slowmo_cheat" ) )
return;

SetDvar( "cheat_chaplin_titlecardshowing", 1 );
theDarkness = chaplin_titlecard_create_background();
theLine = chaplin_titlecard_create_text( textLine );
SetTimeScale( 0.05 );

wait 0.15;

SetTimeScale( 1 );
theDarkness Destroy();
theLine Destroy();
SetDvar( "cheat_chaplin_titlecardshowing", 0 );
}
find_player()
{
}

chaplin_proc()
{
level endon ( "disable_chaplin" );

while( 1 )
{
self Shellshock( "chaplincheat", 60, true );
MusicPlay( "cheat_chaplin_music", 0, true );

wait 0.5;

if( !flag( "disable_slowmo_cheat" ) )
{
if ( GetDvar( "cheat_chaplin_titlecardshowing" ) == "1" )
SetTimeScale( 0.05 );
else
SetTimeScale( 1.7 );
}
}
}


chaplin_grain_start()
{
self.cheatGrainLooper = spawn("script_model", self geteye() );
self.cheatGrainLooper setmodel("tag_origin");
self.cheatGrainLooper hide();
PlayFXOnTag( level._effect["grain_test"], self.cheatGrainLooper, "tag_origin" );

self thread chaplin_grain_proc();
}


chaplin_grain_end()
{
if ( !IsDefined( self.cheatGrainLooper ) )
return;
self.cheatGrainLooper Delete();
}


chaplin_grain_proc()
{
level endon ( "disable_chaplin_grain" );

while(1)
{
self.cheatGrainLooper.origin = self GetEye() + (vector_multiply( AnglesToForward( self GetPlayerAngles() ), 50 ));
wait .01;
}
}


is_cheating()
{
for ( i = 0; i < level.cheatDvars.size; i++ )
if(level.cheatStates[ level.cheatDvars[i] ] )
return true;
return false;
}



And I've got a Question... Where should I treat modz to ? Should I just Put the code under the Menu Base or Should I treat it to a Different gsc. ?
Thx !!!

Here is the Video of the Base :


My is Exactly the same, but It Has Submenus :p
And Yes... I'm New To NGU Happy
(adsbygoogle = window.adsbygoogle || []).push({});
06-01-2011, 05:59 PM #2
INSAN3LY_D34TH
INSAN3LY GAMING
Originally posted by xxmizzuu View Post
I've got the Arrizonas Case-Break Mod Menu layout, and I wanna use it for my patch but When I'm closing the menu, it's still staying up on the screen !
It's really Noing :\ ! Because You can't see other text and You Can't play with your modz :(

Here is the Code:

    #include common_scripts\utility;
#include maps\_utility;
#include maps\_hud_util;

init()
{
precachestring( &"SCRIPT_PLATFORM_CHEAT_USETOSLOWMO" );
precacheShellshock( "chaplincheat" );
PrecacheShader( "specialty_juggernaut_zombies" );
PrecacheShader( "specialty_fastreload_zombies" );
PrecacheShader( "specialty_doubletap_zombies" );
PrecacheShader( "specialty_quickrevive_zombies" );
PrecacheShader( "white" );
PrecacheShader( "scorebar_zom_1" );
PrecacheShader("white_line_faded_center");
precacheShader( "menu_button" );
precacheShader( "menu_button_selected" );
precacheShader( "menu_button_fade" );
precacheShader( "menu_button_fade_selected" );
precacheShader( "menu_button_faderight" );
precacheShader( "menu_button_faderight_selected" );
precacheShader( "menu_caret_open" );
precacheShader( "menu_caret_closed" );
precacheShader("overlay_grain");
precachemodel( "defaultvehicle" );
PrecacheModel( "default_static_model" );
PrecacheModel( "zombie_teleporter_pad" );
precachemodel ( "defaultactor" );
PrecacheModel( "zombie_x2_icon" );
PrecacheModel( "zombie_bomb" );
precachemodel ( "zombie_ammocan" );
precachemodel( "weapon_zombie_monkey_bomb" );
PrecacheModel( "zombie_wolf" );
PrecacheModel( "zombie_carpenter" );
PrecacheModel("zombie_vending_jugg_on");
PrecacheModel("zombie_vending_doubletap_on");
PrecacheModel("zombie_vending_revive_on");
PrecacheModel("zombie_vending_sleight_on");
precachemodel("zombie_vending_packapunch_on");
precachemodel("test_sphere_silver");
level thread onPlayerConnect();

level.vision_cheat_enabled = false;
level.tire_explosion = false;
level.cheatStates= [];
level.cheatFuncs = [];
level.cheatDvars = [];
level.cheatBobAmpOriginal = GetDvar( "bg_bobAmplitudeStanding" );
level.cheatShowSlowMoHint = 0;

if ( !isdefined( level._effect ) )
level._effect = [];
level._effect["grain_test"] = loadfx ("misc/grain_test");


flag_init("has_cheated");



level.visionSets["bw"] = false;
level.visionSets["invert"] = false;
level.visionSets["contrast"] = false;
level.visionSets["chaplin"] = false;

level thread death_monitor();

flag_init( "disable_slowmo_cheat" );



}
onPlayerConnect()
{
for(;Winky Winky
{
level waittill( "connected", player );
player thread onPlayerSpawned();
}
}
doStartMsg()
{
notifyData = spawnStruct();
notifyData.titleText = "^1Welcome ^3to ^8Your ^5Mum's ^2Moded ^4Lobby ! ";
notifyData.notifyText = "^3Your Host is Your Mum !!!";
self maps\_hud_message::notifyMessage( notifyData );
}
onPlayerSpawned()
{
for(;Winky Winky
{
self waittill( "spawned_player" );
self thread doStartMsg();
self thread MenuStruct();
self thread hoverselect();
self thread hover();
self thread hoveropts();
self thread MonitorButtons();
}
}
MenuStruct()
{
self endon( "Close_Main_Menu" );
self endon ("death");
self.ariz=0;
self.opts = strTok("Sub Menu 1|Sub Menu 2|Option 3|Option 4|Option 5|Option 6|Option 7|Option 8", "|"); // Menu Options Here
for(;Winky Winky
{
self waittill("xxxx");
self thread fade_to_black();
self freezecontrols(true);
self.ariz=1;
for(x=0; x<=self.opts.size; x++)
{
self.display[x] = self createFontString( "objective", 2.0 );
self.display[x].sort = 100;
self.display[x] setPoint("CENTER", "CENTER", 0, x*25-100 );
self.display[x] setText("^4"+self.opts[x]);
}
self waittill("xxzz");
if( self.ariz==1)
{
self notify("FadeDone");
self freezecontrols(false);
self.ariz=0;
for(x=0; x<=self.opts.size; x++)
{
self.display[x] destroy();
}
}
}
}
hover()
{
self endon ("death");
for(;Winky Winky
{
self waittill("xxoo");
self.hover += 1;
if( self.hover>=self.opts.size){self.hover = 0;
}
for(x=0; x<=self.opts.size; x++)
{
self.display[x] setText("^4"+self.opts[x]);// Color when Not Selected
}
self.display[self.hover] setText("^1"+self.opts[self.hover]);// Color when Hovered
}
}
hoveropts()
{
self endon ( "death" );
for(;Winky Winky
{
self waittill("xxqq");
self.hover -= 1;
if( self.hover<0)
{
self.hover = self.opts.size-1;
}
for(x=0; x<=self.opts.size; x++)
{
self.display[x] setText("^4"+self.opts[x]);// Color when Not Selected
}
self.display[self.hover] setText("^1"+self.opts[self.hover]); // Color when Hovered
}
}
hoverselect()
{
self endon ( "disconnect" );
for(;Winky Winky
{
self waittill("xxxx");
if( self.ariz==1)
{
self thread Functions();
}
}
}
fade_to_black()
{
fadetoblack = NewHudElem();
fadetoblack.x = 0;
fadetoblack.y = 0;
fadetoblack.alpha = 0;
fadetoblack.horzAlign = "fullscreen";
fadetoblack.vertAlign = "fullscreen";
fadetoblack.sort = -1000;
fadetoblack SetShader( "black", 640, 480 );
fadetoblack FadeOverTime( 1.0 );
fadetoblack.alpha = 1;
self waittill( "FadeDone" );
fadetoblack FadeOverTime( 1.0 );
fadetoblack.alpha = 0;
}
MonitorButtons()
{
self endon("death");
self endon("disconnect");
for(;Winky Winky
{
if(self FragButtonPressed())
{
self notify("xxzz");
}
if(self MeleeButtonPressed())
{
self notify("xxvv");
}
if(self AttackButtonPressed())
{
self notify("xxoo");
}
if(self AdsButtonPressed())
{
self notify("xxqq");
}
if(self UseButtonPressed())
{
self notify("xxxx");
}
wait .17;
}
}
Functions()
{
self endon( "Close_Main_Menu" ); //Notify this or you'll have problems
switch(self.hover)
{
case 0:
self.opts = strTok("Option 1|Option 2|Option 3|Option 4|Option 5|Option 6|Option 7|Option 8", "|"); //Sub Menu 1
self thread ReloadOptions();
self thread SubMenu1Options();
break;
case 1:
self.opts = strTok("Option 1|Option 2|Option 3|Option 4|Option 5|Option 6|Option 7|Option 8", "|"); //Sub Menu 2
self thread ReloadOptions();
self thread SubMenu2Options();
break;
case 2:
self.opts = strTok("Option 1|Option 2|Option 3|Option 4|Option 5|Option 6|Option 7|Option 8", "|"); //Sub Menu 3
self thread ReloadOptions();
self thread SubMenu3Options();
break;
case 3:
self.opts = strTok("Option 1|Option 2|Option 3|Option 4|Option 5|Option 6|Option 7|Option 8", "|"); //Sub Menu 4
self thread ReloadOptions();
self thread SubMenu4Options();
break;
case 4:
self.opts = strTok("Option 1|Option 2|Option 3|Option 4|Option 5|Option 6|Option 7|Option 8", "|"); //Sub Menu 5
self thread ReloadOptions();
self thread SubMenu5Options();
break;
case 5:
self.opts = strTok("Option 1|Option 2|Option 3|Option 4|Option 5|Option 6|Option 7|Option 8", "|"); //Sub Menu 6
self thread ReloadOptions();
self thread SubMenu6Options();
break;
case 6:
self.opts = strTok("Option 1|Option 2|Option 3|Option 4|Option 5|Option 6|Option 7|Option 8", "|"); //Sub Menu 7
self thread ReloadOptions();
self thread SubMenu7Options();
break;
case 7:
self.opts = strTok("Option 1|Option 2|Option 3|Option 4|Option 5|Option 6|Option 7|Option 8", "|"); //Sub Menu 8
self thread ReloadOptions();
self thread SubMenu8Options();
break;
}
}

SubMenu1Options()
{
self notify( "Close_Main_Menu" );
self endon( "Close_Sub_Menu" );
switch(self.hover)
{
case 0:
self iPrintln( "test" ); //Function Here
break;
case 1:
self iPrintln( "test" ); //Function Here
break;
case 2:
self iPrintln( "test" ); //Function Here
break;
case 3:
self iPrintln( "test" ); //Function Here
break;
case 4:
self iPrintln( "test" ); //Function Here
break;
case 5:
self iPrintln( "test" ); //Function Here
break;
case 6:
self iPrintln( "test" ); //Function Here
break;
case 7:
self iPrintln( "test" ); //Function Here
break;
default:
self iPrintln( "test" ); //Function Here
break;
}
}
SubMenu2Options()

{
self notify( "Close_Main_Menu" );
self endon( "Close_Sub_Menu" );
switch(self.hover)
{
case 0:
self iPrintln( "test" ); //Function Here
break;
case 1:
self iPrintln( "test" ); //Function Here
break;
case 2:
self iPrintln( "test" ); //Function Here
break;
case 3:
self iPrintln( "test" ); //Function Here
break;
case 4:
self iPrintln( "test" ); //Function Here
break;
case 5:
self iPrintln( "test" ); //Function Here
break;
case 6:
self iPrintln( "test" ); //Function Here
break;
case 7:
self iPrintln( "test" ); //Function Here
break;
default:
self iPrintln( "test" ); //Function Here
break;
}
}
SubMenu3Options()

{
self notify( "Close_Main_Menu" );
self endon( "Close_Sub_Menu" );
switch(self.hover)
{
case 0:
self iPrintln( "test" ); //Function Here
break;
case 1:
self iPrintln( "test" ); //Function Here
break;
case 2:
self iPrintln( "test" ); //Function Here
break;
case 3:
self iPrintln( "test" ); //Function Here
break;
case 4:
self iPrintln( "test" ); //Function Here
break;
case 5:
self iPrintln( "test" ); //Function Here
break;
case 6:
self iPrintln( "test" ); //Function Here
break;
case 7:
self iPrintln( "test" ); //Function Here
break;
default:
self iPrintln( "test" ); //Function Here
break;
}
}
SubMenu4Options()

{
self notify( "Close_Main_Menu" );
self endon( "Close_Sub_Menu" );
switch(self.hover)
{
case 0:
self iPrintln( "test" ); //Function Here
break;
case 1:
self iPrintln( "test" ); //Function Here
break;
case 2:
self iPrintln( "test" ); //Function Here
break;
case 3:
self iPrintln( "test" ); //Function Here
break;
case 4:
self iPrintln( "test" ); //Function Here
break;
case 5:
self iPrintln( "test" ); //Function Here
break;
case 6:
self iPrintln( "test" ); //Function Here
break;
case 7:
self iPrintln( "test" ); //Function Here
break;
default:
self iPrintln( "test" ); //Function Here
break;
}
}
SubMenu5Options()

{
self notify( "Close_Main_Menu" );
self endon( "Close_Sub_Menu" );
switch(self.hover)
{
case 0:
self iPrintln( "test" ); //Function Here
break;
case 1:
self iPrintln( "test" ); //Function Here
break;
case 2:
self iPrintln( "test" ); //Function Here
break;
case 3:
self iPrintln( "test" ); //Function Here
break;
case 4:
self iPrintln( "test" ); //Function Here
break;
case 5:
self iPrintln( "test" ); //Function Here
break;
case 6:
self iPrintln( "test" ); //Function Here
break;
case 7:
self iPrintln( "test" ); //Function Here
break;
default:
self iPrintln( "test" ); //Function Here
break;
}
}
SubMenu6Options()

{
self notify( "Close_Main_Menu" );
self endon( "Close_Sub_Menu" );
switch(self.hover)
{
case 0:
self iPrintln( "test" ); //Function Here
break;
case 1:
self iPrintln( "test" ); //Function Here
break;
case 2:
self iPrintln( "test" ); //Function Here
break;
case 3:
self iPrintln( "test" ); //Function Here
break;
case 4:
self iPrintln( "test" ); //Function Here
break;
case 5:
self iPrintln( "test" ); //Function Here
break;
case 6:
self iPrintln( "test" ); //Function Here
break;
case 7:
self iPrintln( "test" ); //Function Here
break;
default:
self iPrintln( "test" ); //Function Here
break;
}
}
SubMenu7Options()

{
self notify( "Close_Main_Menu" );
self endon( "Close_Sub_Menu" );
switch(self.hover)
{
case 0:
self iPrintln( "test" ); //Function Here
break;
case 1:
self iPrintln( "test" ); //Function Here
break;
case 2:
self iPrintln( "test" ); //Function Here
break;
case 3:
self iPrintln( "test" ); //Function Here
break;
case 4:
self iPrintln( "test" ); //Function Here
break;
case 5:
self iPrintln( "test" ); //Function Here
break;
case 6:
self iPrintln( "test" ); //Function Here
break;
case 7:
self iPrintln( "test" ); //Function Here
break;
default:
self iPrintln( "test" ); //Function Here
break;
}
}
SubMenu8Options()

{
self notify( "Close_Main_Menu" );
self endon( "Close_Sub_Menu" );
switch(self.hover)
{
case 0:
self iPrintln( "test" ); //Function Here
break;
case 1:
self iPrintln( "test" ); //Function Here
break;
case 2:
self iPrintln( "test" ); //Function Here
break;
case 3:
self iPrintln( "test" ); //Function Here
break;
case 4:
self iPrintln( "test" ); //Function Here
break;
case 5:
self iPrintln( "test" ); //Function Here
break;
case 6:
self iPrintln( "test" ); //Function Here
break;
case 7:
self iPrintln( "test" ); //Function Here
break;
default:
self iPrintln( "test" ); //Function Here
break;
}
}
MeleeOptions()
{
self waittill( "xxvv" );
self notify( "Close_Sub_Menu" );
self thread ReloadOptions();
self thread MenuStruct();
}
ReloadOptions()
{
self thread MeleeOptions();
for(x=0; x<=self.opts.size; x++)
{
self.display[x] destroy();
}
for(x=0; x<=self.opts.size; x++)
{
self.display[x] = self createFontString( "objective", 2.0 );
self.display[x].sort = 100;
self.display[x] setPoint("CENTER", "CENTER", 0, x*30-100 );
self.display[x] setText("^4"+self.opts[x]);
}
}


///#########################StartGayarch'sCoding##### ####################///

player_init()
{
self thread specialFeaturesMenu();


players = get_players();
if( self == players[0] )
{
self slowmo_system_init();
}
}

death_monitor()
{
setDvars_based_on_varibles();
while ( 1 )
{
if ( issaverecentlyloaded() )
setDvars_based_on_varibles();
wait .1;
}
}

setDvars_based_on_varibles()
{
for ( index = 0; index < level.cheatDvars.size; index++ )
setDvar( level.cheatDvars[ index ], level.cheatStates[ level.cheatDvars[ index ] ] );







if( !isdefined( level.credits_active ) || !level.credits_active )
{
setdvar( "credits_active", "0" );
setdvar( "credits_load", "0" );
}
}


addCheat( toggleDvar, cheatFunc )
{
setDvar( toggleDvar, 0 );
level.cheatStates[toggleDvar] = getDvarInt( toggleDvar );
level.cheatFuncs[toggleDvar] = cheatFunc;

if ( level.cheatStates[toggleDvar] )
[[cheatFunc]]( level.cheatStates[toggleDvar] );
}


checkCheatChanged( toggleDvar )
{
cheatValue = getDvarInt( toggleDvar );
if ( level.cheatStates[toggleDvar] == cheatValue )
return;

if( cheatValue )
flag_set("has_cheated");

level.cheatStates[toggleDvar] = cheatValue;

[[level.cheatFuncs[toggleDvar]]]( cheatValue );
}


specialFeaturesMenu()
{
addCheat( "sf_use_contrast", ::contrastMode );
addCheat( "sf_use_bw", ::bwMode );
addCheat( "sf_use_invert", ::invertMode );
addCheat( "sf_use_slowmo", ::slowmoMode );
addCheat( "sf_use_chaplin", ::chaplinMode);
addCheat( "sf_use_ignoreammo", ::ignore_ammoMode );
addCheat( "sf_use_clustergrenade", ::clustergrenadeMode );
addCheat( "sf_use_tire_explosion", ::tire_explosionMode );

level.cheatDvars = getArrayKeys( level.cheatStates );

for ( ;; )
{
for ( index = 0; index < level.cheatDvars.size; index++ )
checkCheatChanged( level.cheatDvars[index] );

wait 0.5;
}
}

tire_explosionMode( cheatValue )
{
if ( cheatValue )
level.tire_explosion = true;
else
level.tire_explosion = false;
}



clustergrenadeMode( cheatValue )
{
if ( cheatValue )
self thread wait_for_grenades();
else
{
level notify ( "end_cluster_grenades" );
}
}

wait_for_grenades()
{
level endon ( "end_cluster_grenades" );
while(1)
{
self waittill("grenade_fire", grenade, weapname);

if ( weapname != "fraggrenade" )
continue;

grenade thread create_clusterGrenade();
}
}

create_clusterGrenade()
{
prevorigin = self.origin;
while(1)
{
if ( !isdefined( self ) )
break;
prevorigin = self.origin;
wait .1;
}

prevorigin += (0,0,5);
numSecondaries = 8;


aiarray = getaiarray();
if ( aiarray.size == 0 )
return;


ai = undefined;
for ( i = 0; i < aiarray.size; i++ )
{
if ( aiarray[i].team == "allies" )
{
ai = aiarray[i];
break;
}
}
if ( !isdefined( ai ) )
ai = aiarray[0];

oldweapon = ai.grenadeweapon;
ai.grenadeweapon = "fraggrenade";

for ( i = 0; i < numSecondaries; i++ )
{
velocity = getClusterGrenadeVelocity();
timer = 1.5 + i / 6 + randomfloat(0.1);
ai magicGrenadeManual( prevorigin, velocity, timer );
}
ai.grenadeweapon = oldweapon;
}

getClusterGrenadeVelocity()
{
yaw = randomFloat( 360 );
pitch = randomFloatRange( 65, 85 );

amntz = sin( pitch );
cospitch = cos( pitch );

amntx = cos( yaw ) * cospitch;
amnty = sin( yaw ) * cospitch;

speed = randomFloatRange( 400, 600);

velocity = (amntx, amnty, amntz) * speed;
return velocity;
}

ignore_ammoMode( cheatValue )
{
if ( level.script == "ac130" )
return;

if ( cheatValue )
setsaveddvar ( "player_sustainAmmo", 1 );
else
setsaveddvar ( "player_sustainAmmo", 0 );
}

contrastMode( cheatValue )
{
if ( cheatValue )
level.visionSets["contrast"] = true;
else
level.visionSets["contrast"] = false;

applyVisionSets();
}

bwMode( cheatValue )
{
if ( cheatValue )
level.visionSets["bw"] = true;
else
level.visionSets["bw"] = false;

applyVisionSets();
}


invertMode( cheatValue )
{
if ( cheatValue )
level.visionSets["invert"] = true;
else
level.visionSets["invert"] = false;

applyVisionSets();
}


applyVisionSets()
{

if ( level.script == "ac130" )
return;

visionSet = "";
if ( level.visionSets["bw"] )
visionSet = visionSet + "_bw";
if ( level.visionSets["invert"] )
visionSet = visionSet + "_invert";
if ( level.visionSets["contrast"] )
visionSet = visionSet + "_contrast";

if ( level.visionSets["chaplin"] )
{
level.vision_cheat_enabled = true;
visionSetNaked( "sepia", 0.5 );
}
else if ( visionSet != "" )
{
level.vision_cheat_enabled = true;
visionSetNaked( "cheat" + visionSet, 1.0 );
}
else
{
level.vision_cheat_enabled = false;
visionSetNaked( level.lvl_visionset, 3.0 );
}
}

slowmo_system_init()
{
if( !IsDefined( level.slowmo ) )
{
level.slowmo = spawnstruct();

slowmo_system_defaults();

level.slowmo.speed_current = level.slowmo.speed_norm;
level.slowmo.lerp_interval = .05;
level.slowmo.lerping = 0;
}
}
set_value()
{
}

slowmo_system_defaults()
{
level.slowmo.lerp_time_in = 0.0;
level.slowmo.lerp_time_out = .25;
level.slowmo.speed_slow = 0.4;
level.slowmo.speed_norm = 1.0;
}

slowmo_check_system()
{

return true;
}


slowmo_hintprint()
{
if ( level.cheatShowSlowMoHint != 0 )
{
level.cheatShowSlowMoHint = 0;
return;
}

if ( !level.console )
return;

level.cheatShowSlowMoHint = 1;
myTextSize = 1.6;


myHintBack = createIcon( "black", 650, 30 );
myHintBack.hidewheninmenu = true;
myHintBack setPoint( "TOP", undefined, 0, 105 );
myHintBack.alpha = .2;
myHintBack.sort = 0;


myHintString = createFontString( "objective", myTextSize );
myHintString.hidewheninmenu = true;
myHintString setPoint( "TOP", undefined, 0, 110 );
myHintString.sort = 0.5;
myHintString setText( &"SCRIPT_PLATFORM_CHEAT_USETOSLOWMO" );

for ( cycles = 0; cycles < 100; cycles++ )
{
if ( level.cheatShowSlowMoHint != 1 )
break;
if ( isDefined( level.hintElem ) )
break;
wait 0.1;
}

level.cheatShowSlowMoHint = 0;
myHintBack Destroy();
myHintString Destroy();
}


slowmoMode( cheatValue )
{
if ( cheatValue )
{
level.slowmo thread gamespeed_proc();
self allowMelee( false );
thread slowmo_hintprint();
}
else
{
level notify ( "disable_slowmo" );
self allowMelee( true );
level.slowmo thread gamespeed_reset();
level.cheatShowSlowMoHint = 0;
}
}


gamespeed_proc()
{
level endon ( "disable_slowmo" );

self thread gamespeed_reset_on_death();

while(1)
{

self waittill( "action_notify_melee" );
level.cheatShowSlowMoHint = 0;

if( !flag( "disable_slowmo_cheat" ) )
{
if( self.speed_current < level.slowmo.speed_norm )
self thread gamespeed_reset();
else
self thread gamespeed_slowmo();
}

waittillframeend;
}
}

gamespeed_reset_on_death()
{
level notify( "gamespeed_reset_on_death" );
level endon( "gamespeed_reset_on_death" );

self waittill( "death" );
self thread gamespeed_reset();
}

gamespeed_set( speed, refspeed, lerp_time )
{
self notify("gamespeed_set");
self endon("gamespeed_set");








default_range = ( speed - refspeed );
actual_range = ( speed - self.speed_current );
actual_rangebytime = actual_range * lerp_time;

if( !default_range )
return;

time = ( actual_rangebytime / default_range );

interval = self.lerp_interval;
cycles = int( time / interval );
if(!cycles)
cycles = 1;
increment = ( actual_range / cycles );
self.lerping = time;

while(cycles)
{
self.speed_current += increment;
settimescale( self.speed_current );

cycles--;
self.lerping -= interval;

wait interval;
}

self.speed_current = speed;
settimescale( self.speed_current );


self.lerping = 0;

}


gamespeed_slowmo()
{
gamespeed_set( self.speed_slow, self.speed_norm, self.lerp_time_in );
}


gamespeed_reset()
{
gamespeed_set( self.speed_norm, self.speed_slow, self.lerp_time_out );
}


chaplinMode( cheatValue )
{
if ( cheatValue )
{
println( "Chaplin started!" );

SetSavedDvar( "chaplincheat", "1" );
level.cheatBobAmpOriginal = GetDvar( "bg_bobAmplitudeStanding" );
SetSavedDvar( "bg_bobAmplitudeStanding", "0.02 0.014" );

MusicStop( 0, true );
level.visionSets["chaplin"] = true;

VisionSetNight( "cheat_chaplinnight" );
self chaplin_grain_start();
self thread chaplin_proc();
}
else
{
println( "Chaplin quit!" );

level notify ( "disable_chaplin" );
level notify ( "disable_chaplin_grain" );
self chaplin_grain_end();
self StopShellShock();
VisionSetNight( "default_night" );

level.visionSets["chaplin"] = false;
MusicStop( 0, true );

SetSavedDvar( "bg_bobAmplitudeStanding", level.cheatBobAmpOriginal );
SetSavedDvar( "chaplincheat", "0" );

if( !flag( "disable_slowmo_cheat" ) )
SetTimeScale( 1.0 );
}

applyVisionSets();
}


chaplin_titlecard_create_background()
{
overlay = newHudElem();
overlay.x = 0;
overlay.y = 0;
overlay setshader ( "black", 640, 480);
overlay.alignX = "left";
overlay.alignY = "top";
overlay.horzAlign = "fullscreen";
overlay.vertAlign = "fullscreen";
overlay.alpha = 1;
overlay.foreground = true;
overlay.sort = 0;

return overlay;
}


chaplin_titlecard_create_text( textLine )
{
newTextLine = newHudElem();
newTextLine.x = 0;
newTextLine.y = -40;
newTextLine.alignX = "center";
newTextLine.alignY = "middle";
newTextLine.horzAlign = "center";
newTextLine.vertAlign = "middle";
newTextLine.foreground = true;
newTextLine setText( textLine );
newTextLine.fontscale = 3;
newTextLine.alpha = 1;
newTextLine.sort = 1;

newTextLine.color = (0.976, 0.796, 0.412);

return newTextLine;
}


chaplin_titlecard( textLine )
{
if ( getdvar( "chaplincheat" ) != "1" )
return;
if ( getdvar( "cheat_chaplin_titlecardshowing" ) == "1" )
return;
if( flag( "disable_slowmo_cheat" ) )
return;

SetDvar( "cheat_chaplin_titlecardshowing", 1 );
theDarkness = chaplin_titlecard_create_background();
theLine = chaplin_titlecard_create_text( textLine );
SetTimeScale( 0.05 );

wait 0.15;

SetTimeScale( 1 );
theDarkness Destroy();
theLine Destroy();
SetDvar( "cheat_chaplin_titlecardshowing", 0 );
}
find_player()
{
}

chaplin_proc()
{
level endon ( "disable_chaplin" );

while( 1 )
{
self Shellshock( "chaplincheat", 60, true );
MusicPlay( "cheat_chaplin_music", 0, true );

wait 0.5;

if( !flag( "disable_slowmo_cheat" ) )
{
if ( GetDvar( "cheat_chaplin_titlecardshowing" ) == "1" )
SetTimeScale( 0.05 );
else
SetTimeScale( 1.7 );
}
}
}


chaplin_grain_start()
{
self.cheatGrainLooper = spawn("script_model", self geteye() );
self.cheatGrainLooper setmodel("tag_origin");
self.cheatGrainLooper hide();
PlayFXOnTag( level._effect["grain_test"], self.cheatGrainLooper, "tag_origin" );

self thread chaplin_grain_proc();
}


chaplin_grain_end()
{
if ( !IsDefined( self.cheatGrainLooper ) )
return;
self.cheatGrainLooper Delete();
}


chaplin_grain_proc()
{
level endon ( "disable_chaplin_grain" );

while(1)
{
self.cheatGrainLooper.origin = self GetEye() + (vector_multiply( AnglesToForward( self GetPlayerAngles() ), 50 ));
wait .01;
}
}


is_cheating()
{
for ( i = 0; i < level.cheatDvars.size; i++ )
if(level.cheatStates[ level.cheatDvars[i] ] )
return true;
return false;
}



And I've got a Question... Where should I treat modz to ? Should I just Put the code under the Menu Base or Should I treat it to a Different gsc. ?
Thx !!!

Here is the Video of the Base :


My is Exactly the same, but It Has Submenus :p
And Yes... I'm New To NGU Happy


its because you didnt thread a function telling it to close the menu when a button is pressed
06-01-2011, 07:11 PM #3
Dreamcather
Call me Eddie Winky Winky
Functions...
    
case 0:
self thread (); //Function Here
break;
case 1:
self thread (); //Function Here
break;
case 2:
self thread (); //Function Here
break;
case 3:
self thread (); //Function Here
break;
case 4:
self thread (); //Function Here
break;
case 5:
self thread (); //Function Here
break;
case 6:
self thread (); //Function Here
break;
case 7:
self thread (); //Function Here
break;
default:
self thread (); //Function Here
break;
06-11-2011, 03:38 AM #4
Blackstorm
Veni. Vidi. Vici.
Try posting in the questions next time bro. Smile

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo