Post: [RELEASE] Some Functions For a Mod Menu
04-14-2015, 06:42 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); I have been working on a Mod Menu for Black Ops 2 Zombies (GreZz 4.1) and thought I would share some of my functions that I use. A few code have just had some minor changes and some are one that I played around with and got working. I also have other codes that work for the maps that they are intended for but they cause script errors when I try to load other maps. Alot of the code that I have gotten to work are mostly just Dev Debug codes changed around to work for my needs. Most of these are just the Functions you will need to call them from the Menu options to make the work (Except the Mules Kick - it needs to be called from onplayerconnect and the player to many weapons montior also needs to be there.)



All functions in Spoiler:




This can be used on transit to open the door and Activate the Power to the Pack a Punch on Transit. ( It can also be made Togglable, but the is just an add in that I used in the Open All Door Script the way it is now).

    

powerp()
{
self endon("disconnect");
level notify( "electric_door" );
clientnotify( "power_on" );
flag_set( "power_on" );
level setclientfield( "zombie_power_on", 1 );
level thread maps/mp/zombies/_zm_perks::perk_unpause_all_perks();
if(GetDvar("mapname") == "zm_transit") //Transit
{
self thread maps/mp/zombies/_zm_game_module::turn_power_on_and_open_doors();
wait 0.25;
self iPrintln("^7PAP Power ^2ON");
}
wait 0.25;
self iPrintln("^7Power ^2ON");
}

[B][U][COLOR="#EE82EE"]This Is How I have it used in my Script.[/COLOR][/U][/B]

[spoiler][code]

OpenAllTehDoors()
{
setdvar("zombie_unlock_all",1);
level notify( "junk purchased" );
level notify( "open_sesame" );
self give_money();
self Pppppower();
wait 0.5;
self iPrintln("Open all the doors ^2Success");
Triggers=StrTok("zombie_doors|zombie_door|zombie_airlock_buy|zombie_debris|electric_door|rock_debris_pile|flag_blocker|window_shutter|zombie_trap","|");
for(a=0;a<Triggers.size;a++)
{
Trigger=GetEntArray(Triggers[a],"targetname");
for(b=0;b<Trigger.size;b++)
{
Trigger[b] notify("trigger");
}
}
wait .1;
setdvar("zombie_unlock_all",0);
}


Pppppower()
{
if(GetDvar("mapname") == "zm_transit") //Transit
{
self powerp();
}
if(GetDvar("mapname") == "zm_highrise") //Die Rise
{
self powerp();
}
if(GetDvar("mapname") == "zm_prison") // Mob of the Dead
{
/*self powerp();*/
}
if(GetDvar("mapname") == "zm_buried") // Buried
{
self powerp();
}
if(GetDvar("mapname") == "zm_tomb") // Origins
{
self powerp();
}
}


powerp()
{
self endon("disconnect");
level notify( "electric_door" );
clientnotify( "power_on" );
flag_set( "power_on" );
level setclientfield( "zombie_power_on", 1 );
level thread maps/mp/zombies/_zm_perks::perk_unpause_all_perks();
if(GetDvar("mapname") == "zm_transit") //Transit
{
self thread maps/mp/zombies/_zm_game_module::turn_power_on_and_open_doors();
wait 0.25;
self iPrintln("^7PAP Power ^2ON");
}
wait 0.25;
self iPrintln("^7Power ^2ON");
}




[/code]




This one right here allows you to give yourself all the Perks on the Map at one time. (It only gives you the Perks that have machines on the map, not perma perks and on Origins you only get the main 4 that have machines. (Jug, Stamina, Revive and Speed Cola).) On a side note this is Treyarcs Code just made it work for my Menu.

    

player_all_perks()
{
self endon("death");
self endon("disconnect");
machines = getentarray( "zombie_vending", "targetname" );
perks = [];
i = 0;
while ( i < machines.size )
{
if ( machines[ i ].script_noteworthy == "specialty_weapupgrade" )
{
i++;
continue;
}
else
{
perks[ perks.size ] = machines[ i ].script_noteworthy;
}
i++;
}
_a539 = perks;
_k539 = getFirstArrayKey( _a539 );
while ( isDefined( _k539 ) )
{
perk = _a539[ _k539 ];
if ( isDefined( self.perk_purchased ) && self.perk_purchased == perk )
{
}
else
{
if ( self hasperk( perk ) || self maps/mp/zombies/_zm_perks::has_perk_paused( perk ) )
{
break;
}
else
{
self maps/mp/zombies/_zm_perks::give_perk( perk, 0 );
wait 0.25;
}
}
_k539 = getNextArrayKey( _a539, _k539 );
}
self._retain_perks = 1;
self iprintln("All Perks ^2Given");
wait .05;
self FermetureMenu(); //This Makes The Menu Close After Thread is Run
wait .25;
}




And This is the one I use for all Perk on Origins:

    

doOriginPreks()
{
self endon("death");
self endon("disconnect");
self doPerks("specialty_armorvest"); // Juggernaut
wait .05;
self doPerks("specialty_fastreload"); //Speed Cola
wait .05;
self doPerks("specialty_rof"); // Double Tap
wait .05;
self doPerks("specialty_grenadepulldeath"); // Electric Cherry
wait .05;
self doPerks("specialty_flakjacket"); // PHD Flopper
wait .05;
self doPerks("specialty_additionalprimaryweapon"); // Mule Kick
wait .05;
self doPerks("specialty_deadshot"); // Deadshot
wait .05;
self doPerks("specialty_longersprint"); //Staminia Up
wait .05;
self doPerks("specialty_quickrevive"); // Quick Revive
wait .05;
self FermetureMenu(); //This Makes The Menu Close After Thread is Run
wait .25;
}





This allow you to have more that 3 guns on maps that have Mule Kick (it is currently set to 8 max) I've tried different amount and anything higher runs into issues.

    
onplayerconnect():
if(isDefined(level.player_too_many_weapons_monitor))
level.player_too_many_weapons_monitor = false;
player thread MuleForAll();

    
MuleForAll()
{
self endon("disconnect");
if ( isDefined( level.zombiemode_using_additionalprimaryweapon_perk ) && level.zombiemode_using_additionalprimaryweapon_perk )
{
level thread mule_kick_4_weapons();
}
}
mule_kick_4_weapons()
{
_a1697 = get_players();
_k1697 = getFirstArrayKey( _a1697 );
while ( isDefined( _k1697 ) )
{
player = _a1697[ _k1697 ];
if ( !isDefined( player._retain_perks_array ) )
{
player._retain_perks_array = [];
}
if ( !player hasperk( "specialty_additionalprimaryweapon" ) )
{
player maps/mp/zombies/_zm_perks::give_perk( "specialty_additionalprimaryweapon", 0 );
}
player._retain_perks_array[ "specialty_additionalprimaryweapon" ] = 1;
_k1697 = getNextArrayKey( _a1697, _k1697 );
}
level.additionalprimaryweapon_limit = 8;
}


Function gives the Gun Camo for the map you are on (ie: if Origins the guns will be the blue crystal looking guns)

    

doWeapon3(i)
{
self endon("disconnect");
self maps/mp/zombies/_zm_weapons::weapon_give(i);
}


Now I know this isn't my code but I updated it so when on Tranit (the Jetgun ) and Buried (Paralyzer) doesn't overheat (unless you turn off the Unlimited ammo). It also make all Lethal, Tactical, and Claymores Unlimited.

    

Toggle_Ammo()
{
self endon("disconnect");
if(self.unlammo==false)
{
self thread MaxAmmo();
self.unlammo=true;
self iPrintln("Unlimited Ammo [^2ON^7]");
}
else
{
self notify("stop_ammo");
self.unlammo=false;
self iPrintln("Unlimited Ammo [^1OFF^7]");
}
}
MaxAmmo()
{
self endon("stop_ammo");
for(;Winky Winky
{
wait 0.1;
weapon = self getcurrentweapon();
if ( weapon != "none" )
{
self setweaponoverheating( 0, 0 );
max = weaponmaxammo( weapon );
if ( isDefined( max ) )
{
self setweaponammostock( weapon, max );
}
if ( isDefined( self get_player_tactical_grenade() ) )
{
self givemaxammo( self get_player_tactical_grenade() );
}
if ( isDefined( self get_player_lethal_grenade() ) )
{
self givemaxammo( self get_player_lethal_grenade() );
}
}
}
}



This is my Round Menu. It has Goto Round 250, 100, then you can go up or down round by 1, 10, or 50 Rounds.

    

max_round()
{
self thread zombiekill();
level.round_number = 250;
self iprintln("Round Set To ^1" + level.round_number + "");
wait 2;
}
round_up_100()
{
self thread ZombieKill();
level.round_number = 99;
self iPrintln("Round Set To ^1"+level.round_number+"");
wait 2;
}
round_up_50()
{
self thread zombiekill();
level.round_number = level.round_number + 49;
self iprintln("Round Set To ^1" + level.round_number + "");
wait 0.5;
}
round_up_10()
{
self thread zombiekill();
level.round_number = level.round_number + 9;
self iprintln("Round Set To ^1" + level.round_number + "");
wait 0.5;
}
round_up()
{
self thread zombiekill();
level.round_number = level.round_number + 1;
self iprintln("Round Set To ^1" + level.round_number + "");
wait 0.5;
}
round_down()
{
self thread zombiekill();
level.round_number = level.round_number - 1;
self iprintln("Round Set To ^1" + level.round_number + "");
wait 0.5;
}
round_down_10()
{
self thread zombiekill();
level.round_number = level.round_number - 9;
self iprintln("Round Set To ^1" + level.round_number + "");
wait 0.5;
}
round_down_50()
{
self thread zombiekill();
level.round_number = level.round_number - 49;
self iprintln("Round Set To ^1" + level.round_number + "");
wait 0.5;
}
round_down_1()
{
self thread zombiekill();
level.round_number = 0;
self iprintln("Round Set To ^1" + level.round_number + "");
wait 2;
}




This is just where you can turn on or off wheither the Mystery box can move..

    
MysteryBoxNoNo()
{
self endon("disconnect");
if( getDvar( "magic_chest_movable" ) == "1" )
{
setdvar( "magic_chest_movable", "0" );
self iPrintln("Mystery Box ^2Can't Move");
}
else if( getDvar( "magic_chest_movable" ) == "0" )
{
setdvar( "magic_chest_movable", "1" );
self iPrintln("Mystery Box ^2Can Move");
}
}



You can use this to give yourself sticky grenades or switch back to frags and I beileve you takeaway the ones you have. (And only on Maps that stickies are included already. I think).

    

dolethal(i)
{
self endon("death");
self endon("disconnect");
self giveweapon(i);
self takeweapon( self get_player_lethal_grenade() );
self set_player_lethal_grenade(i);
}




Just to give Working Emp Grenades on Transit

    

doemps()
{
self endon("death");
self endon("disconnect");
self giveweapon( "emp_grenade_zm" );
self takeweapon( self get_player_tactical_grenade() );
self set_player_tactical_grenade( "emp_grenade_zm" );

self iPrintln("^7Emps ^2Given");
}




This is to give Working Monkey Bombs that function as the should. (Got tired of menus with Dud Monkeys).

    

domonkey()
{
self endon("death");
self endon("disconnect");
self giveweapon( "cymbal_monkey_zm" );
self takeweapon( self get_player_tactical_grenade() );
self set_player_tactical_grenade( "cymbal_monkey_zm" );
self thread monkey_monkey();
}
monkey_monkey()
{
if ( maps/mp/zombies/_zm_weap_cymbal_monkey::cymbal_monkey_exists() )
{
if ( loadout.zombie_cymbal_monkey_count )
{
self maps/mp/zombies/_zm_weap_cymbal_monkey::player_give_cymbal_monkey();
self setweaponammoclip( "cymbal_monkey_zm", loadout.zombie_cymbal_monkey_count );
}
self iPrintln("^7Monkeys ^2Given");
}
}




This allows you to give the Bowie Knife or Galvaknucles (only on Maps that they are already on).

    

doMeleeBG(i)
{
self endon("death");
self endon("disconnect");
self takeweapon( self get_player_melee_weapon() );
self giveweapon(i);
self switchtoweapon( self getcurrentweapon() );
self set_player_melee_weapon(i);
}




This is to give working claymores.

    

doclaymore()
{
self endon("death");
self endon("disconnect");
self giveweapon( "claymore_zm" );
self set_player_placeable_mine( "claymore_zm" );
self setactionslot( 4, "weapon", "claymore_zm" );
self setweaponammostock( "claymore_zm", 2 );
self thread maps/mp/zombies/_zm_weap_claymore::claymore_setup();

self iprintln("Claymores ^2Given");
}




This is for Buried Map. It allows you to give yourself Timebombs that work.

    

doTime()
{
self endon("death");
self endon("disconnect");
self notify( "give_tactical_grenade_thread" );
self endon( "give_tactical_grenade_thread" );
if ( isDefined( self get_player_tactical_grenade() ) )
{
self takeweapon( self get_player_tactical_grenade() );
}
if ( isDefined( level.zombiemode_time_bomb_give_func ) )
{
self [[ level.zombiemode_time_bomb_give_func ]]();
}
self iPrintln("^7Time Bombs ^2Given");
}




This is the Function for giving equipment.. (Turbine, Trample Steam, HeadChopper, Subsurface Resonator, Zombie Shield, Ect) and Also use for the Jetgun on Transit.

    

doequipment_give(i)
{
self endon("death");
self endon("disconnect");
self maps/mp/zombies/_zm_equipment::equipment_buy(i);
}




This is for Mob of the Dead Tommahawks ( I believe the fuction properly Need more testing).

    

Tomma(i)
{
self endon("death");
self endon("disconnect");
self giveweapon(i);
self takeweapon( self get_player_tactical_grenade() );
self set_player_tactical_grenade(i);
}





These Are For Origins:

When activated all you have to do if Dig a spot and it will give you the Gold Shovel (Note you have to pick up a Regular Shovel First). This I got from a Users Post over at NGU. (Bigmoneyhustlin)

    

dogoldshovel()
{
self endon("disconnect");
self.dig_vars[ "n_spots_dug" ]+=225;

self iPrintln("^2NOW FIND A ^1DIG SPOT");
}



When activated Will instantly give all players the Golden Helmet. (Haven't got it to work for individual players yet)

    

dogoldhelmet()
{
self endon("disconnect");
setdvar( "give_helmet", "on" );
_a1153 = getplayers();
_k1153 = getFirstArrayKey( _a1153 );
while ( isDefined( _k1153 ) )
{
player = _a1153[ _k1153 ];
player.dig_vars[ "has_helmet" ] = 1;
n_player = player getentitynumber() + 1;
level setclientfield( "helmet_player" + n_player, 1 );
_k1153 = getNextArrayKey( _a1153, _k1153 );
}
self iPrintln("^2Golden Helmet ^1Given");
}




This will give you Air Strike Nades that function.

    

dobeacon()
{
self endon("death");
self endon("disconnect");
self maps/mp/zombies/_zm_weapons::weapon_give( "beacon_zm" );

self iPrintln("^7Air Strike ^2Given");
}




This One works fine on Origins, But with it in the Menu other Maps won't load and it gives Script error message.
It lets you give Working Upgraded Staffs....


    

doWeapon4(i)
{
self endon("death");
self endon("disconnect");
self GiveWeapon(i);
self SwitchToWeapon(i);
self GiveMaxAmmo(i);
if(GetDvar("mapname") == "zm_tomb") // Origins
{
self thread maps/mp/zm_tomb_utility::update_staff_accessories();
}
self iPrintln("Weapon "+self.Menu.System["MenuTexte"][self.Menu.System["MenuRoot"]][self.Menu.System["MenuCurser"]]+" ^2Given");
}



This one allows you to give yourself Zombie Blood (but again gives Script Error when trying to load on other maps)

    

zbgrab()
{
self endon("death");
self endon("disconnect");

self maps/mp/zombies/_zm_powerup_zombie_blood::zombie_blood_powerup( "zombie_blood", self );
self.zombie_vars[ "zombie_powerup_zombie_blood_time" ] = 180;
}



This allows you to give yourself the Iron Fist (One Inch Punch) (Again gives Script Errors on Other Maps). (Works fine on Origins)

    

Fillboxes(i)
{
self endon("death");
self endon("disconnect");
str_weapon = self getcurrentweapon();
self disable_player_move_states( 1 );
self giveweapon( "zombie_one_inch_punch_flourish" );
self switchtoweapon( "zombie_one_inch_punch_flourish" );
self waittill_any( "player_downed", "weapon_change_complete" );
self switchtoweapon( str_weapon );
self enable_player_move_states();
self takeweapon( "zombie_one_inch_punch_flourish" );
self giveweapon(i);
self set_player_melee_weapon(i);
maps/mp/zombies/_zm_weap_one_inch_punch::monitor_melee_swipe();
self iPrintln("^7Iron Fist ^2Given");
}




This one Opens all the Tunnel Portals to the Crazy Place (Just to get in - Not Out) and stops the walls from coming down. (Again gives Script Errors on Other Maps)

    

StargateSG1()
{
self endon("disconnect");
self iPrintln("^7Stargates ^2Activated");
flag_set( "activate_zone_chamber" );
flag_set( "player_active_in_chamber" );
maps/mp/zm_tomb_teleporter::stargate_teleport_enable( 1 );
maps/mp/zm_tomb_teleporter::stargate_teleport_enable( 2 );
maps/mp/zm_tomb_teleporter::stargate_teleport_enable( 3 );
maps/mp/zm_tomb_teleporter::stargate_teleport_enable( 4 );
setdvar( "open_all_teleporters", "on" );
level notify( "stop_random_chamber_walls" );
level notify( "activate_zone_chamber" );
level notify( "open_all_gramophone_doors" );
maps/mp/zm_tomb_chamber::move_wall_up();
}



[/spoiler]
(adsbygoogle = window.adsbygoogle || []).push({});

The following 9 users say thank you to blakryder1 for this useful post:

BullyWiiPlaza, Devilemi, Im_YouViolateMe, itsSorrow, KillerGamer81, ModyHacker, Rezqaazify, xDebugKiller, xTiibo Modz
04-15-2015, 02:15 AM #11
There is a teleporter Mod for Transit that I seen (ELeGanCe v2.4 i think), and I am also trying to add the box that pops up with the menu that list the controls for menu (this one is just lack of knowledge and coding skills really). There are a few other but I can't think of them right at the moment.
10-13-2015, 12:06 AM #12
BullyWiiPlaza
Climbing up the ladder
Thanks for the awesome codes, bro!

However, I noticed that giving the same lethal or tactical makes them vanish so I fixed this bug and also added a max ammo to the given lethal or tactical :P

    giveLethal(lethal)
{
currentLethal = self get_player_lethal_grenade();

if(currentLethal != lethal)
{
self giveweapon(lethal);
self takeweapon(currentLethal);
self set_player_lethal_grenade(lethal);
}

self givemaxammo(lethal);

self iPrintln("^2Lethals^7 given");
}

giveTactical(tactical)
{
currentTactical = self get_player_tactical_grenade();

if(currentTactical != tactical)
{
self giveweapon(tactical);
self takeweapon(currentTactical);
self set_player_tactical_grenade(tactical);
}

self givemaxammo(tactical);

self thread fixCymbalMonkeys();

self iPrintln("^2Tacticals^7 given");
}

fixCymbalMonkeys()
{
if(self get_player_tactical_grenade() == "cymbal_monkey_zm")
{
if (maps/mp/zombies/_zm_weap_cymbal_monkey::cymbal_monkey_exists())
{
if (loadout.zombie_cymbal_monkey_count)
{
self maps/mp/zombies/_zm_weap_cymbal_monkey::player_give_cymbal_monkey();
self setweaponammoclip("cymbal_monkey_zm", loadout.zombie_cymbal_monkey_count);
}
}
}
}
10-13-2015, 12:20 AM #13
I think it kinda woulda make a bit more sense to post this on one of the four managed code lists, but what do I know
10-13-2015, 12:38 AM #14
BullyWiiPlaza
Climbing up the ladder
Originally posted by John View Post
I think it kinda woulda make a bit more sense to post this on one of the four managed code lists, but what do I know

True, we need more good Zombies scripts in the managed codelists because I'm having a hard time finding them...
10-13-2015, 01:04 AM #15
Originally posted by BullyWiiPlaza View Post
True, we need more good Zombies scripts in the managed codelists because I'm having a hard time finding them...


Ohh, this is for zombies? Well, that changes things up a bit, there isn't a thread specifically for that, but it might be good to start one. You should probably rename the thread and have that included and clean the thread up a bit/make it less ugly (no offense) and maybe you can get it stickied
10-13-2015, 01:06 AM #16
BullyWiiPlaza
Climbing up the ladder
Originally posted by John View Post
Ohh, this is for zombies? Well, that changes things up a bit, there isn't a thread specifically for that, but it might be good to start one. You should probably rename the thread and have that included and clean the thread up a bit/make it less ugly (no offense) and maybe you can get it stickied

Yes, it is for Zombies and it's not my thread. Also I don't know how to rename topics at all.
10-13-2015, 01:48 AM #17
DoraTheKiller97
Treasure hunter
Originally posted by John View Post
I think it kinda woulda make a bit more sense to post this on one of the four managed code lists, but what do I know

There's 4 managed code lists?! Lol
10-13-2015, 01:50 AM #18
Originally posted by BullyWiiPlaza View Post
Yes, it is for Zombies and it's not my thread. Also I don't know how to rename topics at all.


Ah, hadn't realized. I'll give you a quick lesson on how to do that, although this isn't your thread;
We first navigate to one of our threads
Then you want to hit the edit button toward the bottom of your post.

You must login or register to view this content.

Then we click "Go Advanced"

You must login or register to view this content.

And you change your title in the "Title" text box

You must login or register to view this content.

The following 2 users say thank you to John for this useful post:

BullyWiiPlaza, MCabCon
10-13-2015, 01:52 AM #19
Originally posted by dorathekiller97 View Post
There's 4 managed code lists?! Lol


I don't know if this is a sincere question, but I'll answer anyways.
There's actually just three, nonetheless, it's a bit outrageous.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo