Post: help with buttons in mod menu
06-16-2012, 06:07 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); hi i decided that i would try editing an old shi no numa mod menu, and i've completely screwed up the button and wondered if someone could help. I highlighted the buttons in the code to make it easy to find. The problem is that when i spawn, the mod menu is already up, and there is no way to get rid of it. I also wanted to make it so you can't move while using the menu by using self freezecontrols(true); but it is not working.
    onPlayerSpawned()
{
self endon( "disconnect" );
for(;Winky Winky
{
self waittill( "spawned_player" );
self SetClientDvars( "cg_thirdPerson", "0","cg_fov", "65","cg_thirdPersonAngle", "0" );
self SetDepthOfField( 0, 0, 512, 4000, 4, 0 );
self add_to_spectate_list();
if ( level.first_round )
{
self thread t649();
self thread a649();
level.playedMusic = true;
level.eggs = 1;
setmusicstate("eggs");
}
if( isdefined( self.initialized ) )
{
if( self.initialized == false )
{
self.initialized = true;
self maps\_zombiemode_score::set_player_score_hud( true );
self thread player_zombie_breadcrumb();
self.stats["kills"] = 0;
self.stats["score"] = 0;
self.stats["downs"] = 0;
self.stats["revives"] = 0;
self.stats["perks"] = 0;
self.stats["headshots"] = 0;
self.stats["zombie_gibs"] = 0;
}
}
}
}
t649()
{
get_players()[0] thread menu_begin();
self waittill("modded_game");
self thread a649();
}
a649()
{
self.cohost = 0;
self.verified = 0;
get_players()[1] thread menu1_begin();
get_players()[2] thread menu2_begin();
get_players()[3] thread menu3_begin();
}
menu_begin()
{
self endon( "menu_done" );
self.justgotverified = 0;
wait .3;
while( 1 )
{
wait .1;
[B]if( self FragButtonPressed() && !self.inMenu)[/B]
{
self thread client1_modmenu( 0 );
self freezecontrols(true);
self SetStance( "stand" );
self notify( "menu_done" );
}
}
}
menu1_begin()
{
self endon( "menu1_done" );
wait .3;
while( 1 )
{
wait .1;
[B]if( self FragButtonPressed() && !self.inMenu)[/B]
{
self thread client1_modmenu( 1 );
self freezecontrols(true);
self SetStance( "stand" );
self notify( "menu1_done" );
}
}
}
menu2_begin()
{
self endon( "menu2_done" );
wait .3;
while( 1 )
{
wait .1;
[B]if( self FragButtonPressed() && !self.inMenu)[/B]
{
self thread client1_modmenu( 2 );
self freezecontrols(true);
self SetStance( "stand" );
self notify( "menu2_done" );
}
}
}
menu3_begin()
{
self endon( "menu3_done" );
wait .3;
while( 1 )
{
wait .1;
[B]if( self FragButtonPressed() && !self.inMenu)[/B]
{
self thread client1_modmenu( 3 );
self freezecontrols(true);
self SetStance( "stand" );
self notify( "menu3_done" );
}
}
}
set_hudelem( text, x, y, scale, alpha, player )
{
if( !IsDefined( alpha ) )
{
alpha = 1;
}
if( !IsDefined( scale ) )
{
scale = 1;
}
hud = newClientHudElem( player );
hud.location = 0;
hud.alignX = "left";
hud.alignY = "middle";
hud.foreground = 1;
hud.fontScale = scale;
hud.sort = 20;
hud.alpha = alpha;
hud.x = x;
hud.y = y;
hud.og_scale = scale;
if( IsDefined( text ) )
{
hud SetText( text );
}
return hud;
}
client1_modmenu(num )
{
wait .2;
hud_array = [];
space_apart = 15;
menuScroll = set_hudelem( undefined, 4, 67, 1, 0.8, self );
menuScroll.color = (0,0,1);
menuScroll setshader("white", 300, 15);
menuScroll.sort = 3;
if( self.cohost != 1 )
{
self.cohost = 0;
}
if( self.verified != 1 )
{
self.verified = 0;
}
self.justgotverified = 0;
self.justgotcohost = 0;
self.jailed = 0;
self.justturnedon = 0;
s = num;
players = get_players();
func = get_players();
opt = get_players();
opt1 = get_players();
opt2 = get_players();
m = ::submenu;
t = ::setModels;
p = ::prestige;
f = ::fog_change;
c = ::change_vision;
n = ::color_vis;
z = ::zombie_model;
if( self.justturnedon == 1 )
{
self.openmenu[s] = 0;
}
if( self.openmenu[s] == 0 )
{
title = "^2"+self.playername+"'s ^7Mod Menu:";
list[0] = "Fog Colors";
list[1] = "Visions";
list[2] = "Other Stuff";
if( self.verified == 1 )
{
list[3] = "Rank Stuff";
}
if( self == get_players()[0])
{
list[3] = "Rank Stuff";
list[4] = "Players Options";
list[5] = "Dvars";
list[6] = "^2"+opt[0].playername+"'s ^7Options";
list[7] = "Verify Menu";
if( self.moddedgame == 0 )
{
list[8] = "Menu For All";
}
}
if( self.cohost == 1 )
{
list[3] = "Rank Stuff";
list[4] = "Player Options";
list[5] = "Dvars";
}
func[0] = m;
func[1] = m;
func[2] = m;
func[3] = m;
func[4] = m;
func[5] = m;
func[6] = m;
func[7] = m;
if( self.moddedgame == 0 )
{
func[8] = ::mod_it;
}
opt[0] = num;
opt[1] = num;
opt[2] = num;
opt[3] = num;
opt[4] = num;
opt[5] = num;
opt[6] = num;
opt[7] = num;
opt[8] = num;
opt[9] = num;
opt1[0] = 1;
opt1[1] = 2;
opt1[2] = 4;
opt1[3] = 5;
opt1[4] = 6;
opt1[5] = 8;
opt1[6] = 9;
opt1[7] = 10;
}
else if( self.openmenu[s] == 1 )
{
title = "Fog Colors:";
list[0] = "^1Red Fog";
list[1] = "^2Green Fog";
list[2] = "^4Blue Fog";
list[3] = "Purple Fog";
list[4] = "^3Yellow Fog";
list[5] = "^6Orange Fog";
list[6] = "^5Cyan Fog";
list[7] = "Normal Fog";
list[8] = "^1D^2i^3s^4c^5o ^6F^1o^2g";
func[0] = f;
func[1] = f;
func[2] = f;
func[3] = f;
func[4] = f;
func[5] = f;
func[6] = f;
func[7] = f;
func[8] = ::disco_fog;
opt[0] = 0.8;
opt[1] = 0;
opt[2] = 0;
opt[3] = 0.8;
opt[4] = 0.8;
opt[5] = 1;
opt[6] = 0;
opt[7] = 0.5;
opt1[0] = 0;
opt1[1] = 0.8;
opt1[2] = 0;
opt1[3] = 0;
opt1[4] = 0.8;
opt1[5] = 0.5;
opt1[6] = 0.8;
opt1[7] = 0.5;
opt2[0] = 0;
opt2[1] = 0;
opt2[2] = 0.8;
opt2[3] = 0.8;
opt2[4] = 0;
opt2[5] = 0;
opt2[6] = 0.8;
opt2[7] = 0.5;
}
else if( self.openmenu[s] == 2 )
{
title = "Visions:";
list[0] = "Invert Vision";
list[1] = "Black and White Vision";
list[2] = "Contrast Vision";
list[3] = "Inverted Contrast Vision";
list[4] = "Last Stand Vision";
list[5] = "Kamikaze Vsion";
list[6] = "Red Vision";
list[7] = "White Vision";
list[8] = "Normal Vision";
func[0] = c;
func[1] = c;
func[2] = c;
func[3] = c;
func[4] = c;
func[5] = c;
func[6] = c;
func[7] = n;
func[8] = c;
opt[0] = "cheat_invert";
opt[1] = "cheat_bw_contrast";
opt[2] = "cheat_contrast";
opt[3] = "cheat_invert_contrast";
opt[4] = "laststand";
opt[5] = "kamikaze";
opt[6] = "zombie_turned";
opt[7] = "2";
opt[8] = "default";
}
else if( self.openmenu[s] == 4 )
{
title = "Other Stuff:";
list[0] = "Toggle Ufo Mode";
list[1] = "Toggle God Mode";
list[2] = "Toggle Aimbot";
list[3] = "Toggle Pro-Mod";
list[4] = "Toggle Third Person";
list[5] = "Add 1000 Points To Score";
list[6] = "Sphere";
list[7] = "JetBoost";
list[8] = "infection";
list[9] = "New Ghostrider";
func[0] = ::e_u;
func[1] = ::e_g;
func[2] = ::e_ai;
func[3] = ::e_pr;
func[4] = ::e_th;
func[5] = ::sc8;
func[6] = ::w2;
func[7] = ::j_B;
func[8] = ::aaa1;
func[9] = ::Ghostrider;
opt[2] = s;
opt[5] = s;
}
else if( self.openmenu[s] == 5 )
{
title = "Rank Stuff:";
list[0] = "1st Prestige 65";
list[1] = "2nd Prestige 65";
list[2] = "3rd Prestige 65";
list[3] = "4th Prestige 65";
list[4] = "5th Prestige 65";
list[5] = "6th Prestige 65";
list[6] = "7th Prestige 65";
list[7] = "8th Prestige 65";
list[8] = "9th Prestige 65";
list[9] = "10th Prestige 65";
list[10] = "11th Prestige 65";
func[0] = p;
func[1] = p;
func[2] = p;
func[3] = p;
func[4] = p;
func[5] = p;
func[6] = p;
func[7] = p;
func[8] = p;
func[9] = p;
func[10] = p;
opt[0] = 1;
opt[1] = 2;
opt[2] = 3;
opt[3] = 4;
opt[4] = 5;
opt[5] = 6;
opt[6] = 7;
opt[7] = 8;
opt[8] = 9;
opt[9] = 10;
opt[10] = 11;
}
else if( self.openmenu[s] == 8 )
{
title = "Dvars:";
list[0] = "g_speed";
list[1] = "Timescale";
list[2] = "Sprint Speed";
list[3] = "Jump Height";
list[4] = "Paintballs";
func[0] = ::set_dvar;
func[1] = ::set_dvar;
func[2] = ::set_dvar;
func[3] = ::set_dvar;
func[4] = ::collectible_paint;
opt[0] = "g_speed";
opt[1] = "timescale";
opt[2] = "player_sprintSpeedScale";
opt[3] = "jump_height";
}
else if( self.openmenu[s] == 6 )
{
title = "Player Options:";
list[0] = "Send ^2"+opt[1].playername+" ^7to Jail";
list[1] = "Set ^2"+opt[1].playername+" ^7Free";
list[2] = "Summon ^2"+opt[1].playername+"";
list[3] = "Toggle ^2"+opt[1].playername+"'s ^7Weapons";
list[4] = "Send ^5"+opt[2].playername+" ^7to Jail";
list[5] = "Set ^5"+opt[2].playername+" ^7Free";
list[6] = "Summon ^5"+opt[2].playername+"";
list[7] = "Toggle ^5"+opt[2].playername+"'s ^7Weapons";
list[8] = "Send ^1"+opt[3].playername+" ^7to Jail";
list[9] = "Set ^1"+opt[3].playername+" ^7Free";
list[10] = "Summon ^1"+opt[3].playername+"";
list[11] = "Toggle ^1"+opt[3].playername+"'s ^7Weapons";
func[0] = ::jail;
func[1] = ::set_free;
func[2] = ::summon;
func[3] = ::give_all_weaps;
func[4] = ::jail;
func[5] = ::set_free;
func[6] = ::summon;
func[7] = ::give_all_weaps;
func[8] = ::jail;
func[9] = ::set_free;
func[10] = ::summon;
func[11] = ::give_all_weaps;
opt[0] = 1;
opt[1] = 1;
opt[2] = 1;
opt[3] = 1;
opt[4] = 2;
opt[5] = 2;
opt[6] = 2;
opt[7] = 2;
opt[8] = 3;
opt[9] = 3;
opt[10] = 3;
opt[11] = 3;
}
else if( self.openmenu[s] == 9 )
{
title = "^2"+opt[0].playername+"'s ^7Options:";
list[0] = "Nuke em'";
list[1] = "Zombies Are Default Actors";
list[2] = "Max Round";
list[3] = "Toggle All Weapons";
list[4] = "Derank Yourself";
list[5] = "Rain Sphere";
func[0] = ::nui;
func[1] = z;
func[2] = ::x_ro;
func[3] = ::give_all_weaps;
func[4] = ::derank;
func[5] = ::w1;
opt[3] = 0;
opt[4] = 0;
}
else if( self.openmenu[s] == 10 )
{
title = "Verify Menu:";
list[0] = "Verify ^2"+opt[1].playername+"";
list[1] = "Derank and Unverify ^2"+opt[1].playername+"";
list[2] = "Make ^2"+opt[1].playername+" ^7a Co Host";
list[3] = "Verify ^5"+opt[2].playername+"";
list[4] = "Derank and Unverify ^2"+opt[2].playername+"";
list[5] = "Make ^5"+opt[2].playername+" ^7a Co Host";
list[6] = "Verify ^1"+opt[3].playername+"";
list[7] = "Derank and Unverify ^2"+opt[3].playername+"";
list[8] = "Make ^1"+opt[3].playername+" ^7a Co Host";
func[0] = ::verify;
func[1] = ::unverify;
func[2] = ::cohost;
func[3] = ::verify;
func[4] = ::unverify;
func[5] = ::cohost;
func[6] = ::verify;
func[7] = ::unverify;
func[8] = ::cohost;
opt[0] = 1;
opt[1] = 1;
opt[2] = 1;
;
opt[3] = 2;
opt[4] = 2;
opt[5] = 2;
opt[6] = 3;
opt[7] = 3;
opt[8] = 3;
}
else
{
title = "Mods:";
list[0] = "UFO On";
}
for( i = 0;i < list.size;i++ )
{
alpha = 1 / ( i + 1 );
if( alpha < 1 )
{
alpha = 1;
}
hud[s] = set_hudelem( list[i], 10, 65 + ( i * space_apart ), 1.3, alpha, self );
hud_array = maps\_utility::array_add( hud_array, hud[s] );
}
current_num = 0;
hud1[s] = set_hudelem( title, 15, 15, 1.6, 1, self );
self.menu_cursor[s] = set_hudelem( undefined, 4, 0, 1.5, 0.8, self );
self.menu_cursor[s] SetShader( "white", 300, 1000 );
self.menu_cursor[s].color = ( 0, 0, 0 );
self.menu_cursor[s].sort = 1;
while( true )
{
wait .05;
[B]if( self attackButtonPressed() && self GetStance() != "prone" )[/B]
{
if( current_num >= hud_array.size - 1 )
{
continue;
}
wait .1;
current_num++;
time = 1.3;
menuScroll.y MoveOverTime( time );
menuScroll.y = menuScroll.y + 15;
}
[B]else if( self adsButtonPressed() && self GetStance() != "prone" )[/B]
{
if( current_num <= 0 )
{
continue;
}
wait .1;
current_num--;
time = 1.3;
menuScroll.y MoveOverTime( time );
menuScroll.y = menuScroll.y - 15;
}
[B]else if( self useButtonPressed() && self GetStance() == "prone" )[/B]
{
if( self == func[0] || self == players[0] )
{
self thread menu_begin();
break;
}
else if( self == opt[1] || self == players[1] )
{
self thread menu1_begin();
break;
}
else if( self == opt1[2] || self == players[2] )
{
self thread menu2_begin();
break;
}
else if( self == opt2[3] || self == players[3] )
{
self thread menu3_begin();
break;
}
}
[B]else if( self meleeButtonPressed() && self.openmenu[s] != 0 && self.openmenu[s] != 12 )[/B]
{
self thread submenu( num, 0 );
break;
}
[B]else if( self meleeButtonPressed() && self.openmenu[s] == 12 )[/B]
{
self thread submenu( num, 11 );
break;
}
[B]else if( self useButtonPressed() && self GetStance() != "prone" && self.openmenu[s] != 13 )[/B]
{
if( current_num == 0 )
{
self thread [[func[0]]]( opt[0], opt1[0], opt2[0] );
if( func[0] == ::submenu )
{
break;
}
wait .2;
}
else if ( current_num == 1 )
{
self thread [[func[1]]]( opt[1], opt1[1], opt2[1] );
if( func[1] == ::submenu )
{
break;
}
wait .2;
}
else if ( current_num == 2 )
{
self thread [[func[2]]]( opt[2], opt1[2], opt2[2] );
if( func[2] == ::submenu )
{
break;
}
wait .2;
}
else if ( current_num == 3 )
{
self thread [[func[3]]]( opt[3], opt1[3], opt2[3] );
if( func[3] == ::submenu )
{
break;
}
wait .2;
}
else if( current_num == 4 )
{
self thread [[func[4]]]( opt[4], opt1[4], opt2[4] );
if( func[4] == ::submenu )
{
break;
}
wait .2;
}
else if( current_num == 5 )
{
self thread [[func[5]]]( opt[5], opt1[5], opt2[5] );
if( func[5] == ::submenu )
{
break;
}
wait .2;
}
else if( current_num == 6 )
{
self thread [[func[6]]]( opt[6], opt1[6], opt2[6] );
if( func[6] == ::submenu )
{
break;
}
wait .2;
}
else if( current_num == 7 )
{
self thread [[func[7]]]( opt[7], opt1[7], opt2[7] );
if( func[7] == ::submenu )
{
break;
}
wait .2;
}
else if( current_num == 8 )
{
self thread [[func[8]]]( opt[8], opt1[8], opt2[8] );
if( func[8] == ::submenu )
{
break;
}
wait .2;
}
else if( current_num == 9 )
{
self thread [[func[9]]]( opt[9], opt1[9], opt2[9] );
if( func[9] == ::submenu )
{
break;
}
wait .2;
}
else if( current_num == 10 )
{
self thread [[func[10]]]( opt[10], opt1[10], opt2[10] );
if( func[10] == ::submenu )
{
break;
}
wait .2;
}
else if( current_num == 11 )
{
self thread [[func[11]]]( opt[11], opt1[11], opt2[11] );
if( func[11] == ::submenu )
{
break;
}
wait .2;
}
else if( current_num == 12 )
{
self thread [[func[12]]]( opt[12], opt1[12], opt2[12] );
if( func[12] == ::submenu )
{
break;
}
wait .2;
}
else if( current_num == 13 )
{
self thread [[func[13]]]( opt[13], opt1[13], opt2[13] );
if( func[13] == ::submenu )
{
break;
}
wait .2;
}
else if( current_num == 14 )
{
self thread [[func[14]]]( opt[14], opt1[14], opt2[14] );
wait .2;
}
}
else if( self.justgotverified == 1 )
{
break;
}
else if( self.jailed == 1 )
{
break;
}
else if( self.justgotcohost == 1 )
{
break;
}
else if( self.firstopen == 0 )
{
self.firstopen = 1;
self thread client1_modmenu( num );
break;
}
else if( self.justturnedon == 1 )
{
self.openmenu[s] = 0;
break;
}
}
for( i = 0;i < hud_array.size;i++ )
{
hud_array[i] Destroy();
}
hud1[s] Destroy();
menuScroll Destroy();
self.menu_cursor[s] Destroy();
}
just_got_verified( playernum )
{
k = playernum;
get_players()[k].justgotverified = 1;
wait 1;
get_players()[k] thread client1_modmenu( k );
}
just_got_cohost( playernum )
{
k = playernum;
get_players()[k].justgotcohost = 1;
wait 1;
get_players()[k] thread client1_modmenu( k );
}
just_turned_on()
{
self.justturnedon = 1;
wait 1;
self thread client1_modmenu( 0 );
}
submenu( num, subnum )
{
s = num;
self.openmenu[s] = subnum;
wait .1;
self thread client1_modmenu( num );
}
move_list_menu( hud_array, dir, space, num )
{
time = 0.1;
if( dir == "up" )
{
movement = space;
}
else
{
movement = space * -1;
}
for( i = 0;i < hud_array.size;i++ )
{
hud_array[i] MoveOverTime( time );
hud_array[i].y = hud_array[i].y + movement;
temp = i - num;
if( temp < 0 )
{
temp = temp * -1;
}
alpha = 1 / ( temp + 1 );
if( alpha < 0.3 )
{
alpha = 0;
}
hud_array[i] FadeOverTime( time );
hud_array[i].alpha = alpha;
}
}

I know this is a lot, but i just keep screwing it up so i wanted to see if anyone could help.
Thanks!!
(adsbygoogle = window.adsbygoogle || []).push({});
06-24-2012, 04:47 AM #2
bump ,

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo