JayCoder

Insane-Known Member
Staff member
Messages
347
Points
478
hello cabcon
back at this again I guess....
looking for help on making code shorter and more complex
also I am in need of more ideas

error's i'm in need of help with
Give weapon function not working

preview 2
preview 3

code below/video above before added functions

Fixes for a lot, menu structure updated

hud updates added a few functions

added custom font,added more functions
Code:
function zombies_build()
{
 //Main Menu
 Main_Menu = strTok(" Power Ups | Weapons | Upgraded Weapons | Gameplay | Perks | UI | Cheats | Menu Editor | Messages | Free | Credits", "|");
 Main_Menu1 = strTok("PU|WEAP|WEAP2|GP|PERK|UI|CHEAT|ME|MSG|FREE|CRED", "|");
 for(J = 0;J < Main_Menu.size;J++)
 {
  self MM("Help Shop", undefined);
  self MO("Help Shop", J, Main_Menu[J], &Calls, Main_Menu1[J]);
 }
 
 //PowerUps
 Power_Ups = GetArrayKeys(level.zombie_powerup_array);
 for(J = 0;J < Power_Ups.size;J++)
 {
  self MM("Power Ups", "Help Shop");
  self MO("Power Ups", J, level.zombie_powerup_array[J], &zombies_scripts::SendPowerUp, level.zombie_powerup_array[J]);
 }
 
 //Weapons //
    NormalWeapons = GetArrayKeys(level.zombie_weapons);
    for ( J = 0;J < NormalWeapons.size;J++ )
    {
  self MM("Normal Weapons", "Help Shop");
        self MO("Normal Weapons", J, NormalWeapons[J].name, &zombies_scripts::BuyWeapon, NormalWeapons[J]);
    }
 
    UpgradedWeapons = GetArrayKeys(level.zombie_weapons_upgraded);
    for ( J = 0;J < UpgradedWeapons.size;J++ )
    {
  self MM("Upgraded Weapons","Help Shop");
        self MO("Upgraded Weapons", J, UpgradedWeapons[J].name, &zombies_scripts::BuyWeapon, UpgradedWeapons[J]);
    }
 
 //Gameplay
 Gameplay = strTok(" 15s Super Jump | 15s Super Speed | 15sec Slowmotion | 15s NoGravity | Pause", "|");
 Gameplay1 = strTok("15sSJ|15sSS|15sSM|15sNG|Pause", "|");
 for(J = 0;J < Gameplay.size;J++)
 {
  self MM("Gameplay", "Help Shop");
  self MO("Gameplay", J, Gameplay[J], &Calls, Gameplay[J]);
 }
 
 //Perks
 Perks = strTok(" Juggernut | QuickRevive | Speedcola | DoubleTap", "|");
 Perks1 = strTok("JUG|QR|SC|DT", "|");
 for(J = 0;J < Perks.size;J++)
 {
  self MM("Perks", "Help Shop");
  self MO("Perks", J, Perks[J], &Calls, Perks[J]);
 }
 //UI
 UIMENU = strTok(" HealthBar | ToggleHud | UILIST | FPS", "|");
 UIMENU1 = strTok("HB|TH|UILT|FPS", "|");
 for(J = 0;J < UIMENU.size;J++)
 {
  self MM("UI", "Help Shop");
  self MO("UI", J, UIMENU[J], &Calls, UIMENU[J]);
 }
 
 //Cheats
 Cheats = strTok(" 15s Super Jump | 15s Super Speed | 15s No Gravity | 15s Inf Ammo | 15s God | 15s Demigod | Minigun | Give Ammo | Aimbot | Devlines | Esp", "|");
 Cheats1 = strTok("15SJ|15SS|15NG|15IA|15GOD|15DEM|MG|GA|AB|DL|ESP", "|");
 for(J = 0;J < Cheats.size;J++)
 {
  self MM("Cheats", "Help Shop");
  self MO("Cheats", J, Cheats[J], &Calls, Cheats[J]);
 }
 
 //Menu Editor // - EXTRA - NOT ADDED ATM
 MenuE = strTok(" Menu RGB | Menu Hud | Menu Position", "|");
 MenuE1 = strTok("MRGB|MHUD|MENUP", "|");
 for(J = 0;J < MenuE.size;J++)
 {
  self MM("Menu Editor", "Help Shop");
  self MO("Menu Editor", J, MenuE[J], &Calls, MenuE[J]);
 }
 
 //Messages
 Messages = strTok(" Assuming | Jaycoder | Agreedbog381 | Donate Gawkbox | Add Snapchat | Add Instagram", "|");
 Messages1 = strTok("Assum|381|GAWK|SNAP|GRAM", "|");
 for(J = 0;J < Messages.size;J++)
 {
  self MM("Messages", "Help Shop");
  self MO("Messages", J, Messages[J], &Calls, Messages[J]);
 }
 
 //Free
 Free = strTok(" WallHack | Far-Knife | FPS | UILIST | BIGNAMES", "|");
 Free1 = strTok("WH|FK|FPS|UIL|BN", "|");
 for(J = 0;J < Free.size;J++)
 {
  self MM("Free", "Help Shop");
  self MO("Free", J, Free[J], &Calls, Free[J]);
 }
 
 //Credits
 Credits = strTok(" InMenu Credits | Assumingagates | Jaycoder | Agreedbog381 | Vampytwist", "|");
 Credits1 = strTok("IC|AAG|JC|AB381|TWIST", "|");
 for(J = 0;J < Credits.size;J++)
 {
  self MM("Credits", "Help Shop");
  self MO("Credits", J, Credits[J], &Calls, Credits[J]);
 }
}
function Calls(i)
{
 switch(i)
 {
  // Main Menu //
  case "PU":
  SML("Power Ups");
  break;
 
  case "WEAP":
  SML("Normal Weapons");
  break;
 
  case "WEAP2":
  SML("Upgraded Weapons");
  break;
 
  case "GP":
  SML("Gameplay");
  break;
 
  case "PERK":
  SML("Perks");
  break;
 
  case "UI":
  SML("UI");
  break;
 
  case "CHEAT":
  SML("Cheats");
  break;
 
  case "ME":
  SML("Menu Editor");
  break;
 
  case "MSG":
  SML("Messages");
  break;
 
  case "FREE":
  SML("Free");
  break;
 
  case "CRED":
  SML("Credits");
  break;
 
  //Gameplay //
 
  case "15sSJ":
  test();
  break;
 
  case "15sSS":
  test();
  break;
 
  case "15sSM":
  test();
  break;
 
  case "15sNG":
  test();
  break;
 
  case "Pause":
  test();
  break;
 
  // Perks //
 
  case "JUG":
  zombies_scripts::GiveMainPerks("specialty_armorvest");
  break;
 
  case "QR":
  zombies_scripts::GiveMainPerks("specialty_fastreload");
  break;
 
  case "SC":
  zombies_scripts::GiveMainPerks("specialty_quickrevive");
  break;
 
  case "DT":
  zombies_scripts::GiveMainPerks("specialty_rof");
  break;
 
  // UI //
 
  case "HB":
  zombies_scripts::Healthbar();
  break;
 
  case "TH":
  zombies_scripts::ToggleHud();
  break;
 
  case "UILT":
  zombies_scripts::UIList();
  break;
 
  case "FPS":
  zombies_scripts::FPS();
  break;
 
  // Cheats //
 
  case "15SJ":
  test();
  break;
 
  case "15SS":
  test();
  break;
 
  case "15NG":
  test();
  break;
 
  case "15IA":
  test();
  break;
 
  case "15GOD":
  test();
  break;
 
  case "15DEM":
  test();
  break;
 
  case "MG":
  test();
  break;
 
  case "GA":
  test();
  break;
 
  case "AB":
  test();
  break;
 
  case "ESP":
  test();
  break;
 
  case "15SJ":
  test();
  break;
 
  // Messages //
  case "Assum":
  zombies_scripts::M("Assumingagates Is A ****ing Boss");
  break;
 
  case "381":
  zombies_scripts::M("Agreedbog381 Is Too Smart For His Owm Good");
  break;
 
  case "GAWK":
  zombies_scripts::M("Assumingagates GAWK: Gawkbox");
  break;
 
  case "SNAP":
  zombies_scripts::M("Assumingagates SNAP: Snapchat");
  break;
 
  case "GRAM":
  zombies_scripts::M("Assumingagates Insta: Instagram");
  break;
 
  // Free //
  case "WH":
  zombies_scripts::WallHack();
  break;
 
  case "FK":
  zombies_scripts::Far_Knife();
  break;
 
  case "FPS":
  zombies_scripts::FPS();
  break;
 
  case "UIL":
  zombies_scripts::UIList();
  break;
 
  case "BN":
  zombies_scripts::BigNames();
  break;
 
  // Credits //
  case "IC":
  test();
  break;
 
  case "AAG":
  test();
  break;
 
  case "JC":
  test();
  break;
 
  case "AB381":
  test();
  break;
 
  case "TWIST":
  test();
  break;
 }
}
thank you for your help

- jaycoder
 
Last edited:

vampytwist

"Don't you trust me?"
Staff member
Messages
527
Points
558
In the strTok for your give weapons you're using _mp for zombies, also in black ops 3 you don't need to use _zm or _mp prefix to give weapons like in past cod's. And a more efficient way in my opinion for giving weapons in zombies is to do something like this:

Code:
 //Non upgraded weapons
   self MM("weapons","Normal Weapons");
    a_keys = GetArrayKeys(level.zombie_weapons);
    for ( i = 0; i < a_keys.size; i++ )
    {
        self MO("Weapons", i, a_keys[i].name, &GiveWeaponClass, a_keys[i]);
    }
Code:
 //All upgraded weapons
    self MM("papweaps","Upgraded Weapons");
    a_keys = GetArrayKeys(level.zombie_weapons_upgraded);
    for ( i = 0; i < a_keys.size; i++ )
    {
        self MO("Weapons", i, a_keys[i].name, &GiveWeaponClass, a_keys[i]);
    }
 

JayCoder

Insane-Known Member
Staff member
Messages
347
Points
478
In the strTok for your give weapons you're using _mp for zombies, also in black ops 3 you don't need to use _zm or _mp prefix to give weapons like in past cod's. And a more efficient way in my opinion for giving weapons in zombies is to do something like this:

Code:
 //Non upgraded weapons
   self MM("weapons","Normal Weapons");
    a_keys = GetArrayKeys(level.zombie_weapons);
    for ( i = 0; i < a_keys.size; i++ )
    {
        self MO("Weapons", i, a_keys[i].name, &GiveWeaponClass, a_keys[i]);
    }
Code:
 //All upgraded weapons
    self MM("papweaps","Upgraded Weapons");
    a_keys = GetArrayKeys(level.zombie_weapons_upgraded);
    for ( i = 0; i < a_keys.size; i++ )
    {
        self MO("Weapons", i, a_keys[i].name, &GiveWeaponClass, a_keys[i]);
    }
is level.zombie_weapons already defined in the game?
 

Top