CabConModding
Facebook
Twitter
youtube
Discord
Contact us
RSS
Menu
CabConModding
Home
New
Top
Premium
Rules
FAQ - Frequently Asked Questions
Games
Fornite
Call of Duty: Black Ops 3
Clash of Clans
Grand Theft Auto 5
Apex Legends
Assassin’s Creed Origins
Forums
Premium
Latest posts
What's new
Latest posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Log in
Register
What's new
Premium
Latest posts
Menu
Log in
Register
Navigation
Install the app
Install
More options
Dark Theme
Contact us
Close Menu
Forums
Gaming
Call of Duty Classics
Call of Duty: Black Ops 2
Call of Duty: Black Ops 2 Mods and Scripts
Call of Duty: Black Ops 2 Scripts
Call of Duty: Black Ops 2 Scripts Questions
Call of Duty: Black Ops 2 Answered Questions
Why do I get this error?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="CabCon" data-source="post: 20753" data-attributes="member: 1"><p>Yes, I will reopen the thread and fix your issue.</p><p></p><p><em><span style="color: #ff0000">Thread reopened.</span></em></p><p><em><span style="color: #ff0000"></span></em></p><p><em><span style="color: #ff0000"></span></em></p><p><span style="color: #000000"><strong>EDIT:</strong></span></p><p>With this code, I'm not getting a openmenu() error. The game just freezes on the startup:</p><p>[CODE]#include maps\mp\_utility;</p><p>#include common_scripts\utility;</p><p>#include maps\mp\gametypes\_hud_util;</p><p>#include maps\mp\gametypes\_hud_message;</p><p></p><p>init()</p><p>{</p><p> level.name = "level";</p><p></p><p> addColor("black", (0, 0, 0));</p><p> addColor("white", (1, 1, 1));</p><p> addColor("red", (1, 0, 0));</p><p> addColor("yellow", (1, 1, 0));</p><p> addColor("green", (0, 1, 0));</p><p> addColor("blue", (0,0, 1));</p><p> addColor("purple", (1, 0, 1));</p><p> addColor("cyan", (0, 1, 1));</p><p> addColor("gray", (0.5, 0.5, 0.5));</p><p> addColor("orange", (0.95, 0.52, 0.0285));</p><p></p><p> addTheme("Surge", "orange", "black");</p><p> addTheme("Cherry", "red", "white");</p><p> addTheme("Poison", "green", "black");</p><p> addTheme("Death Star", "cyan", "black");</p><p> addTheme("Obsidian", "purple", "black");</p><p> addTheme("NextGenUpdate", "cyan", "gray");</p><p> addTheme("Se7enSins", "green", "gray");</p><p></p><p> level.lastIndex = 14;</p><p> </p><p> level thread game_end();</p><p> level thread connected();</p><p>}</p><p></p><p>connected()</p><p>{</p><p> for(;;)</p><p> {</p><p> level waittill("connected", player);</p><p> player.access = Iif(player isHost(), 3, 0);</p><p> </p><p> player waittill("spawned_player");</p><p> if(player isHost())</p><p> player initOccult();</p><p> </p><p> if(level.script[0] != "m")</p><p> continue;</p><p> </p><p> while(isAlive(player))</p><p> {</p><p> player.occult["locked"] = true;</p><p> player SetClientUIVisibilityFlag("hud_visible", 0);</p><p> player EnableInvulnerability();</p><p> player FreezeControls(true);</p><p> player DisableWeapons();</p><p> player Hide();</p><p> </p><p> zoomHeight = 5000;</p><p> zoomBack = 4000;</p><p> yaw = 55; //should be pitch (as far as i know) but ok</p><p> </p><p> origin = player.origin;</p><p> player.origin = origin + vector_scale(AnglesToForward(player.angles + (0, -180, 0)), zoomBack) + (0, 0, zoomHeight);</p><p> </p><p> ent = spawn("script_model", (0 ,0, 0));</p><p> ent.angles = player.angles + (yaw, 0, 0);</p><p> ent.origin = player.origin;</p><p> ent SetModel("tag_origin");</p><p> </p><p> player PlayerLinkToAbsolute(ent);</p><p> ent MoveTo(origin + (0, 0, 0), 4, 2, 2);</p><p> wait 1;</p><p> </p><p> ent RotateTo((ent.angles[0] - yaw, ent.angles[1], 0), 3, 1, 1);</p><p> wait 0.5;</p><p> </p><p> player PlayLocalSound("ui_camera_whoosh_in");</p><p> wait 2.5;</p><p> </p><p> player Unlink();</p><p> wait 0.2;</p><p> </p><p> ent Delete();</p><p> player EnableWeapons();</p><p> player Show();</p><p> player FreezeControls(false);</p><p> wait .4;</p><p> </p><p> player DisableInvulnerability();</p><p> player SetClientUIVisibilityFlag("hud_visible", 1);</p><p> break;</p><p> }</p><p> player.occult["locked"] = false;</p><p> }</p><p>}</p><p></p><p>vector_scale(vec, scale)</p><p>{</p><p> vec = (vec[0]*scale, vec[1]*scale, vec[2]*scale);</p><p> return vec;</p><p>}</p><p></p><p>initOccult()</p><p>{</p><p> self notify("#end");</p><p></p><p> self.occult = [];</p><p> self.occult["menu"] = [];</p><p></p><p> self.occult["current"] = [];</p><p> self.occult["current"]["menu"] = "Occult";</p><p> self.occult["current"]["lindex"] = [];</p><p> self.occult["current"]["oindex"] = [];</p><p> self.occult["current"]["sindex"] = [];</p><p></p><p> self.occult["locked"] = false;</p><p> self.occult["active"] = false;</p><p> self.occult["closing"] = false;</p><p></p><p> self.occult["toggles"] = [];</p><p> self.occult["toggles"]["reset"] = [];</p><p></p><p> self.occult["hud"] = [];</p><p> self.occult["hud"]["text"] = [];</p><p> self.occult["hud"]["shader"] = [];</p><p></p><p> setColor("panel", "black");</p><p> setColor("glow", "orange");</p><p> setColor("title", "orange");</p><p> setColor("options", "white");</p><p> setColor("scrollbar", "orange");</p><p> setColor("background", "black");</p><p></p><p> self thread drawHud();</p><p> self thread createMenu();</p><p> self thread monitorButtons();</p><p>}</p><p></p><p>monitorButtons()</p><p>{</p><p> self endon("#end");</p><p></p><p> for(;;)</p><p> {</p><p> while(isAlive(self))</p><p> {</p><p> if(!self.occult["locked"])</p><p> {</p><p> if(!self.occult["active"])</p><p> {</p><p> if(self ActionSlotOneButtonPressed())</p><p> self loadMenu();</p><p></p><p> if(self ActionSlotFourButtonPressed())</p><p> ExitLevel();</p><p> }</p><p> if(self.occult["active"] && !self.occult["closing"])</p><p> {</p><p> if(self UseButtonPressed())</p><p> {</p><p> if(!isEmpty(self getParent()))</p><p> self submenu(self getParent());</p><p> else</p><p> self closeMenu();</p><p> wait 0.2;</p><p> }</p><p> if(self ActionSlotTwoButtonPressed())</p><p> {</p><p> self closeMenu();</p><p> wait 0.2;</p><p> }</p><p> if(self AttackButtonPressed() || self AdsButtonPressed())</p><p> {</p><p> menu = self getCurrent("menu");</p><p> if(self AttackButtonPressed())</p><p> {</p><p> self.occult["current"]["oindex"][menu]--;</p><p> if(self.occult["current"]["oindex"][menu] < 0)</p><p> {</p><p> self.occult["current"]["oindex"][menu] = self.occult["menu"][menu]["options"].size - 1;</p><p> self.occult["current"]["sindex"][menu] = self.occult["current"]["lindex"][menu];</p><p></p><p> index = 0;</p><p> last_index = self.occult["current"]["lindex"][menu];</p><p> for(i = self.occult["current"]["oindex"][menu] - last_index; i < self.occult["menu"][menu]["options"].size; i++)</p><p> {</p><p> self.occult["hud"]["text"]["options"][index] setText(self.occult["menu"][menu]["options"][i]["label"]);</p><p> index++;</p><p> }</p><p> self updateScrollbar();</p><p> }</p><p> else</p><p> {</p><p> if(self.occult["current"]["sindex"][menu] == 0)</p><p> {</p><p> index = 0;</p><p> last_index = self.occult["current"]["lindex"][menu];</p><p> for(i = self.occult["current"]["oindex"][menu]; i < self.occult["current"]["oindex"][menu] + last_index + 1; i++)</p><p> {</p><p> self.occult["hud"]["text"]["options"][index] setText(self.occult["menu"][menu]["options"][i]["label"]);</p><p> index++;</p><p> }</p><p> }</p><p> else</p><p> {</p><p> self.occult["current"]["sindex"][menu]--;</p><p> self updateScrollbar();</p><p> }</p><p> }</p><p> }</p><p> else</p><p> {</p><p> self.occult["current"]["oindex"][menu]++;</p><p> if(self.occult["current"]["oindex"][menu] > self.occult["menu"][menu]["options"].size - 1)</p><p> {</p><p> self.occult["current"]["oindex"][menu] = 0;</p><p> self.occult["current"]["sindex"][menu] = 0;</p><p></p><p> for(i = 0; i < self.occult["current"]["lindex"][menu] + 1; i++)</p><p> self.occult["hud"]["text"]["options"][i] setText(self.occult["menu"][menu]["options"][i]["label"]);</p><p> self updateScrollbar();</p><p> }</p><p> else</p><p> {</p><p> if(self.occult["current"]["sindex"][menu] == self.occult["current"]["lindex"][menu])</p><p> {</p><p> index = 0;</p><p> last_index = self.occult["current"]["lindex"][menu];</p><p> for(i = self.occult["current"]["oindex"][menu] - last_index; i < self.occult["current"]["oindex"][menu] + 1; i++)</p><p> {</p><p> self.occult["hud"]["text"]["options"][index] setText(self.occult["menu"][menu]["options"][i]["label"]);</p><p> index++;</p><p> }</p><p> }</p><p> else</p><p> {</p><p> self.occult["current"]["sindex"][menu]++;</p><p> self updateScrollbar();</p><p> }</p><p> }</p><p> }</p><p> self thread scrollbarEffect();</p><p> wait 0.2;</p><p> }</p><p> if(self JumpButtonPressed())</p><p> {</p><p> selected = self getMenu()["options"][self getCurrent("oindex")];</p><p></p><p> //so you dont have to re-enter name of the submenu -> addOption("SubMenu 1", &submenu);</p><p> if(selected["func"] == ::submenu && isEmpty(selected["input"]))</p><p> selected["input"] = selected["label"];</p><p></p><p> //prevent text from moving if the option is "submenu" / move text if option is submenu but menu doesnt exist</p><p> if(selected["func"] != ::submenu || selected["func"] == ::submenu && isEmpty(self.occult["menu"][selected["input"]]))</p><p> {</p><p> elem = self.occult["hud"]["text"]["options"][self getCurrent("sindex")];</p><p> elem elemMoveX(0.07, elem.x - 5);</p><p></p><p> wait 0.25;</p><p> elem thread elemMoveX(0.07, -10);</p><p> }</p><p></p><p> //if submenu doesnt exist</p><p> if(selected["func"] == ::submenu && isEmpty(self.occult["menu"][selected["input"]]))</p><p> {</p><p> self iprintln("^1ERROR: ^3Cannot enter submenu: submenu does not exist");</p><p> continue;</p><p> }</p><p></p><p> //cred fallen</p><p> if(selected["type"] == "thread")</p><p> {</p><p> if(isEmpty(selected["input"]))</p><p> selected["entity"] thread [[selected["func"]]]();</p><p> else if(isArray(selected["input"]))</p><p> {</p><p> if(selected["input"].size == 0)</p><p> self iprintln("^1ERROR: ^3Cannot call function: no arguments passed");</p><p></p><p> else if(selected["input"].size == 1)</p><p> selected["entity"] thread [[selected["func"]]](selected["input"][0]);</p><p></p><p> else if(selected["input"].size == 2)</p><p> selected["entity"] thread [[selected["func"]]](selected["input"][0], selected["input"][1]);</p><p></p><p> else if(selected["input"].size == 3)</p><p> selected["entity"] thread [[selected["func"]]](selected["input"][0], selected["input"][1], selected["input"][2]);</p><p></p><p> else if(selected["input"].size == 4)</p><p> selected["entity"] thread [[selected["func"]]](selected["input"][0], selected["input"][1], selected["input"][2], selected["input"][3]);</p><p></p><p> else if(selected["input"].size == 5)</p><p> selected["entity"] thread [[selected["func"]]](selected["input"][0], selected["input"][1], selected["input"][2], selected["input"][3], selected["input"][4]);</p><p></p><p> else</p><p> self iprintln("^1ERROR: ^3Cannot call function: too many arguments passed");</p><p> }</p><p> else</p><p> selected["entity"] thread [[selected["func"]]](selected["input"]);</p><p> }</p><p> else if(selected["type"] == "immediate")</p><p> {</p><p> if(isEmpty(selected["input"]))</p><p> selected["entity"] [[selected["func"]]]();</p><p> else if(isArray(selected["input"]))</p><p> selected["entity"] [[selected["func"]]](selected["input"][0], selected["input"][1], selected["input"][2], selected["input"][3], selected["input"][4]);</p><p> else</p><p> selected["entity"] [[selected["func"]]](selected["input"]);</p><p> }</p><p></p><p> //tell player that func was called on ent</p><p> if(selected["entity"] != self)</p><p> self iPrintln(selected["label"] + " was called on " + selected["entity"].name);</p><p> wait 0.2;</p><p> }</p><p> }</p><p> }</p><p> wait 0.05;</p><p> }</p><p> reset = Iif(self.occult["toggles"]["reset"].size > 0, "^3Reset Toggles", "");</p><p> </p><p> toggles = getArrayKeys(self.occult["toggles"]["reset"]);</p><p> foreach(toggle in toggles)</p><p> {</p><p> state = self.occult["toggles"]["reset"][toggle];</p><p> </p><p> setVar(toggle, !state);</p><p> self notify("stop_" + toggle);</p><p> }</p><p> self.occult["toggles"]["reset"] = [];</p><p></p><p> self iPrintLn(reset);</p><p> self waittill("spawned_player");</p><p> }</p><p>}</p><p></p><p>addColor(name, color)</p><p>{</p><p> if(!isDefined(level.colors))</p><p> level.colors = [];</p><p></p><p> level.colors[name] = color;</p><p>}</p><p></p><p>addTheme(name, primary, secondary)</p><p>{</p><p> if(!isDefined(level.themes))</p><p> level.themes = [];</p><p></p><p> level.themes[name] = [];</p><p> level.themes[name]["primary"] = level.colors[primary];</p><p> level.themes[name]["secondary"] = level.colors[secondary];</p><p>}</p><p></p><p>Iif(bool, var1, var2)</p><p>{</p><p> if(bool)</p><p> return var1;</p><p> return var2;</p><p>}</p><p></p><p>game_end()</p><p>{</p><p> level waittill("game_ended");</p><p> wait 0.25;</p><p></p><p> foreach(player in level.players)</p><p> {</p><p> if(player isAllowed())</p><p> {</p><p> player closeMenu();</p><p> player.occult["locked"] = true;</p><p> }</p><p> }</p><p>}</p><p></p><p>isAllowed(n)</p><p>{</p><p> return self.access >= Iif(!isDefined(n), 1, n);</p><p>}</p><p></p><p>verify(player, access)</p><p>{</p><p> if(!player isHost())</p><p> {</p><p> if(self isAllowed(player.access + 1) || self isHost())</p><p> {</p><p> if(access != 0)</p><p> {</p><p> if(player.access == 0)</p><p> player initOccult();</p><p></p><p> player.access = access;</p><p> player iPrintLn("Access Level changed to " + access);</p><p></p><p> self iPrintLn(player.name + "'s Access Level changed to " + access);</p><p> }</p><p> else</p><p> {</p><p> player.occult["locked"] = true;</p><p> player closeMenu();</p><p> player suicide();</p><p></p><p> wait 0.05;</p><p> player notify("#end");</p><p> player.occult = undefined;</p><p> }</p><p> }</p><p> }</p><p> else</p><p> self iPrintLn("^3You cannot change the host's access level");</p><p>}</p><p></p><p>isEmpty(x)</p><p>{</p><p> if(!isDefined(x) || x == "")</p><p> return 1;</p><p> return 0;</p><p>}</p><p></p><p>addMenu(parent, name)</p><p>{</p><p> self.occult["menu"][name] = [];</p><p> self.occult["menu"][name]["options"] = [];</p><p> self.occult["menu"][name]["parent"] = parent;</p><p> self.occult["menu"][name]["label"] = name;</p><p></p><p> self.occult["current"]["lindex"][name] = 0;</p><p> self.occult["current"]["oindex"][name] = 0;</p><p> self.occult["current"]["sindex"][name] = 0;</p><p></p><p> if(!isEmpty(self.occult["menu"][parent]))</p><p> self addOption(parent, name, ::submenu);</p><p>}</p><p></p><p>addOption(menu, label, func, input, type, entity)</p><p>{</p><p> index = self.occult["menu"][menu]["options"].size;</p><p> self.occult["menu"][menu]["options"][index] = [];</p><p></p><p> self.occult["menu"][menu]["options"][index]["label"] = label;</p><p> self.occult["menu"][menu]["options"][index]["func"] = func;</p><p> self.occult["menu"][menu]["options"][index]["input"] = input;</p><p> self.occult["menu"][menu]["options"][index]["type"] = Iif(!isDefined(type), "thread", type);</p><p> self.occult["menu"][menu]["options"][index]["entity"] = Iif(!isDefined(entity), self, entity);</p><p></p><p> if(index < level.lastIndex)</p><p> self.occult["current"]["lindex"][menu] = index;</p><p> else</p><p> self.occult["current"]["lindex"][menu] = level.lastIndex;</p><p>}</p><p></p><p>createMenu()</p><p>{</p><p> main = "Occult";</p><p> self addMenu(undefined, main);</p><p></p><p> self addMenu(main, "Mods");</p><p> self addOption("Mods", "Ammo w/ reset", ::toggle, array("ammo", true));</p><p> self addOption("Mods", "Ammo no reset", ::toggle, "ammo");</p><p></p><p> self addOption(main, "Menu does not exist", ::submenu);</p><p></p><p> for(i = 0; i < 18; i++)</p><p> {</p><p> menu = "SubMenu " + (i + 1);</p><p> self addMenu(main, menu);</p><p> for(n = 0; n < 18; n++)</p><p> {</p><p> option = "Option " + (n + 1);</p><p> self addOption(menu, option, ::test);</p><p> }</p><p> }</p><p>}</p><p></p><p>loadMenu()</p><p>{</p><p> self FreezeControls(false);</p><p> self EnableInvulnerability();</p><p> self SetClientUIVisibilityFlag("hud_visible", 0);</p><p></p><p> self showHud();</p><p> self.occult["active"] = true;</p><p>}</p><p></p><p>closeMenu()</p><p>{</p><p> self.occult["closing"] = true;</p><p> self hideHud();</p><p></p><p> self.occult["closing"] = false;</p><p> wait 0.15;</p><p></p><p> self SetClientUIVisibilityFlag("hud_visible", 1);</p><p> self.occult["active"] = false;</p><p></p><p> if(!self.occult["toggles"]["god"])</p><p> self DisableInvulnerability();</p><p>}</p><p></p><p>drawHud()</p><p>{</p><p> top = 50;</p><p> margin = 25;</p><p></p><p> color = self.occult["colors"];</p><p> self.occult["hud"]["shader"]["background"] = self createRectangle("LEFT", "CENTER", 0, 0, 0, 500, 2, color["background"], 0, "white");</p><p> self.occult["hud"]["shader"]["scrollbar"] = self createRectangle("RIGHT", "TOP", 0, top + (2 * margin), 6, margin, 9, color["scrollbar"], 0, "white");</p><p> self.occult["hud"]["shader"]["shadow"] = self createRectangle("RIGHT", "CENTER", 0, 0, 5, 500, 3, color["panel"], 0, "white");</p><p> self.occult["hud"]["shader"]["header"] = self createRectangle("RIGHT", "TOP", -5, top, 500, 40, 5, color["panel"], 0, "white");</p><p> self.occult["hud"]["shader"]["panel"] = self createRectangle("RIGHT", "CENTER", 0, 0, 0, 500, 2, color["panel"], 0, "white");</p><p> self.occult["hud"]["shader"]["glow"] = self createRectangle("RIGHT", "CENTER", 0, 0, 0, 500, 1, color["glow"], 0, "white");</p><p>}</p><p></p><p>showHud()</p><p>{</p><p> self.occult["hud"]["shader"]["header"] elemFade(0.1, 0.65);</p><p> self.occult["hud"]["text"]["title"] elemFade(0.1, 1);</p><p></p><p> self.occult["hud"]["shader"]["panel"] elemFade(0.1, 0.5);</p><p> self.occult["hud"]["shader"]["panel"] scaleOverTime(0.25, 540, 500);</p><p> self.occult["hud"]["shader"]["background"] elemFade(0.1, 0.5);</p><p> self.occult["hud"]["shader"]["background"] scaleOverTime(0.25, 540, 500);</p><p> self.occult["hud"]["shader"]["shadow"] elemFade(0.25, 0.5);</p><p></p><p> self.occult["hud"]["shader"]["glow"] elemFade(0.1, 0.5);</p><p> self.occult["hud"]["shader"]["glow"] scaleOverTime(0.25, 1000, 500);</p><p> self.occult["hud"]["shader"]["glow"] thread pulseEffect(0.4, 0.5, 2);</p><p></p><p> menu = self getCurrent("menu");</p><p> self updateText(menu);</p><p></p><p> self updateScrollbar();</p><p> self.occult["hud"]["shader"]["scrollbar"] elemFade(0.25, 1);</p><p>}</p><p></p><p>hideHud()</p><p>{</p><p> self.occult["hud"]["shader"]["header"] elemFade(0.1, 0);</p><p> self.occult["hud"]["text"]["title"] elemFade(0.1, 0);</p><p></p><p> for(i = 0; i < self.occult["hud"]["text"]["options"].size; i++)</p><p> {</p><p> self.occult["hud"]["text"]["options"][i] thread elemMoveX(0.25, 0);</p><p> self.occult["hud"]["text"]["options"][i] elemFade(0.25, 0);</p><p> self.occult["hud"]["text"]["options"][i] destroy();</p><p> }</p><p> </p><p> self.occult["hud"]["shader"]["glow"] notify("pulse_end");</p><p> self.occult["hud"]["shader"]["glow"] elemFade(0.4, 0);</p><p> self.occult["hud"]["shader"]["glow"] scaleOverTime(0.25, 1, 500);</p><p> self.occult["hud"]["shader"]["shadow"] elemFade(0.4, 0);</p><p> self.occult["hud"]["shader"]["background"] elemFade(0.4, 0);</p><p> self.occult["hud"]["shader"]["background"] scaleOverTime(0.25, 1, 500);</p><p> self.occult["hud"]["shader"]["panel"] elemFade(0.4, 0);</p><p> self.occult["hud"]["shader"]["panel"] scaleOverTime(0.25, 1, 500);</p><p> self.occult["hud"]["shader"]["scrollbar"].alpha = 0;</p><p>}</p><p></p><p>updateScrollbar()</p><p>{</p><p> self.occult["hud"]["shader"]["scrollbar"] elemMoveY(0.15, self.occult["hud"]["text"]["options"][self getCurrent("sindex")].y);</p><p>}</p><p></p><p>getCurrent(input)</p><p>{</p><p> if(input == "menu")</p><p> return self.occult["current"]["menu"];</p><p> return self.occult["current"][input][self.occult["current"]["menu"]];</p><p>}</p><p></p><p>getMenu(menu)</p><p>{</p><p> return self.occult["menu"][Iif(!isDefined(menu), self getCurrent("menu"), menu)];</p><p>}</p><p></p><p>getParent(menu)</p><p>{</p><p> return self.occult["menu"][Iif(!isDefined(menu), self getCurrent("menu"), menu)]["parent"];</p><p>}</p><p></p><p>setColor(elem, name)</p><p>{</p><p> if(!isDefined(self.occult["colors"]))</p><p> self.occult["colors"] = [];</p><p></p><p> self.occult["colors"][elem] = level.colors[name];</p><p>}</p><p></p><p>submenu(input)</p><p>{</p><p> if(isDefined(self.occult["menu"][input]))</p><p> {</p><p> if(!self.occult["closing"] && self.occult["active"])</p><p> {</p><p> if(self.access > 0)</p><p> {</p><p> self menuTransitionOut();</p><p> wait 0.25;</p><p></p><p> for(i = 0; i < self.occult["hud"]["text"]["options"].size; i++)</p><p> self.occult["hud"]["text"]["options"][i] destroy();</p><p></p><p> self.occult["current"]["menu"] = input;</p><p> self updateText(input);</p><p></p><p> self.occult["hud"]["shader"]["glow"] notify("pulse_end");</p><p> self.occult["hud"]["shader"]["glow"] thread pulseEffect(0.4, 0.5, 2);</p><p></p><p> self updateScrollbar();</p><p> self.occult["hud"]["shader"]["scrollbar"] scaleOverTime(0.25, 5, 25);</p><p> }</p><p> else</p><p> self iPrintln("^1You do not have permission to enter this menu");</p><p> }</p><p> else</p><p> self iPrintln("^1ERROR: ^3Cannot enter submenu: menu is closing");</p><p> }</p><p> else</p><p> self iPrintln("^1ERROR: ^3Cannot enter submenu: menu does not exist");</p><p>}</p><p></p><p>menuTransitionOut()</p><p>{</p><p> for(i = 0; i < self.occult["hud"]["text"]["options"].size; i++)</p><p> {</p><p> self.occult["hud"]["text"]["options"][i] elemFade(0.25, 0);</p><p> self.occult["hud"]["text"]["options"][i] thread elemMoveX(0.25, 0);</p><p> }</p><p> </p><p> self.occult["hud"]["shader"]["scrollbar"] scaleOverTime(0.25, 540, 25);</p><p> self.occult["hud"]["text"]["title"] elemFade(0.25, 0);</p><p> self.occult["hud"]["text"]["title"] thread elemMoveX(0.25, 0);</p><p>}</p><p></p><p>test()</p><p>{</p><p> self IPrintLn("^1M NAME JEFF");</p><p>}</p><p></p><p>elemMoveX(time, x)</p><p>{</p><p> self MoveOverTime(time);</p><p> self.x = x;</p><p>}</p><p></p><p>elemMoveY(time, y)</p><p>{</p><p> self MoveOverTime(time);</p><p> self.y = y;</p><p>}</p><p></p><p>elemFade(time, alpha)</p><p>{</p><p> self FadeOverTime(time);</p><p> self.alpha = alpha;</p><p>}</p><p></p><p>pulse(state)</p><p>{</p><p> if(state == true)</p><p> self thread pulseEffect(0.5, 1, 0.5);</p><p> else</p><p> self notify("pulse_end");</p><p></p><p> self.pulsing = state;</p><p>}</p><p></p><p>pulseEffect(min, max, time)</p><p>{</p><p> self endon("pulse_end");</p><p></p><p> for(;;)</p><p> {</p><p> self elemFade(time, max);</p><p> wait time;</p><p> self elemFade(time, min);</p><p> wait time;</p><p> }</p><p>}</p><p></p><p>scrollbarEffect()</p><p>{</p><p> for(i = 0; i < self.occult["hud"]["text"]["options"].size; i++)</p><p> {</p><p> if(i == self getCurrent("sindex"))</p><p> self.occult["hud"]["text"]["options"][i] elemFade(0.25, 1);</p><p> else</p><p> self.occult["hud"]["text"]["options"][i] elemFade(0.25, 0.5);</p><p> }</p><p>}</p><p></p><p>updateText(input)</p><p>{</p><p> top = 50;</p><p> margin = 25;</p><p></p><p> color = self.occult["colors"];</p><p> self.occult["current"]["menu"] = input;</p><p></p><p> label = self.occult["menu"][input]["label"];</p><p> self.occult["hud"]["text"]["title"] destroy();</p><p> self.occult["hud"]["text"]["title"] = self createText("RIGHT", "TOP", 0, top, "bigfixed", 1, 7, color["title"], 0, label);</p><p> self.occult["hud"]["text"]["title"] elemFade(0.25, 1);</p><p> self.occult["hud"]["text"]["title"] thread elemMoveX(0.25, -10);</p><p></p><p> self.occult["hud"]["text"]["options"] = [];</p><p> f_index = self.occult["current"]["oindex"][input] - (self.occult["current"]["lindex"][input] - (self.occult["current"]["lindex"][input] - self.occult["current"]["sindex"][input]));</p><p> l_index = self.occult["current"]["oindex"][input] + self.occult["current"]["lindex"][input] - self.occult["current"]["sindex"][input] + 1;</p><p></p><p> index = 0;</p><p> for(i = f_index; i < l_index; i++)</p><p> {</p><p> self.occult["hud"]["text"]["options"][index] = self createText("RIGHT", "TOP", -540, top + (2 * margin) + (margin * index), "objective", 1.4, 7, color["options"], 0, self.occult["menu"][input]["options"][i]["label"]);</p><p> self.occult["hud"]["text"]["options"][index] thread elemMoveX(0.25, -10);</p><p> self.occult["hud"]["text"]["options"][index] elemFade(0.25, 0.5);</p><p> index++;</p><p> }</p><p> self thread scrollbarEffect();</p><p>}</p><p></p><p></p><p>createRectangle(align, relative, x, y, width, height, sort, color, alpha, shader)</p><p>{</p><p> shaderElem = newClientHudElem(self);</p><p> shaderElem.elemType = "bar";</p><p> shaderElem.sort = sort;</p><p> shaderElem.color = color;</p><p> shaderElem.alpha = alpha;</p><p> shaderElem setParent(level.uiParent);</p><p> shaderElem setShader(shader, width, height);</p><p> shaderElem.hideWhenInMenu = true;</p><p> shaderElem setPoint(align, relative, x, y);</p><p> shaderElem.type = "shader";</p><p> return shaderElem;</p><p>}</p><p></p><p>createText(align, relative, x, y, font, fontscale, sort, color, alpha, text)</p><p>{</p><p> textElem = self CreateFontString(font, fontscale);</p><p> textElem setPoint(align, relative, x, y);</p><p> textElem.sort = sort;</p><p> textElem.alpha = alpha;</p><p> textElem.hideWhenInMenu = true;</p><p> textElem setText(text);</p><p> textElem.type = "text";</p><p> textElem.color = color;</p><p> return textElem;</p><p>}</p><p></p><p>diconnect()</p><p>{</p><p> self.occult = undefined;</p><p> foreach(player in level.players)</p><p> {</p><p> if(player isAllowed())</p><p> {</p><p> menu = player.occult["menu"]["Players"];</p><p> ArrayRemoveIndex(menu["options"], self.name);</p><p></p><p> if(player getParent() == "Players" && player getCurrent("menu") == self.name)</p><p> {</p><p> player submenu("Players");</p><p> player iPrintln("^3Entered parent menu: " + self.name + " left the game");</p><p> }</p><p> }</p><p> }</p><p> self notify("#end");</p><p>}</p><p></p><p>setVar(name, value)</p><p>{</p><p> self.occult["toggles"][name] = value;</p><p>}</p><p></p><p>getVar(name)</p><p>{</p><p> return Iif(!isDefined(self.occult["toggles"][name]), false, self.occult["toggles"][name]);</p><p>}</p><p></p><p>resetUponDeath(x)</p><p>{</p><p> if(isInArray(GetArrayKeys(self.occult["toggles"]["reset"]), x))</p><p> ArrayRemoveIndex(self.occult["toggles"]["reset"], x, true);</p><p> else</p><p> self.occult["toggles"]["reset"][x] = getVar(x);</p><p>}</p><p></p><p>toggle(x, reset, state)</p><p>{</p><p> setVar(x, Iif(isEmpty(state), !getVar(x), state));</p><p> </p><p> if(getVar(x) == true)</p><p> status = "^2Enabled";</p><p> else</p><p> status = "^1Disabled";</p><p> </p><p> if(reset == true)</p><p> resetUponDeath(x);</p><p></p><p> if(x == "god")</p><p> {</p><p> self iPrintln("God Mode: " + status);</p><p></p><p> if(getVar(x) == true)</p><p> self EnableInvulnerability();</p><p> else</p><p> {</p><p> //Only disable if not in menu; else will be disabled upon menu exit</p><p> if(self.occult["active"] == false)</p><p> self DisableInvulnerability();</p><p> }</p><p> }</p><p> else if(x == "ammo")</p><p> {</p><p> self iPrintln("Infinite Ammo: " + status);</p><p> </p><p> if(getVar(x) == true)</p><p> {</p><p> self notify("stop_" + x);</p><p> self thread infiniteAmmo();</p><p> }</p><p> else</p><p> self notify("stop_" + x);</p><p> }</p><p>}</p><p></p><p>infiniteAmmo()</p><p>{</p><p> self endon("stop_ammo");</p><p> for(;;)</p><p> {</p><p> if(self getcurrentweapon() != "none")</p><p> {</p><p> self setweaponammostock( self getcurrentweapon(), 1337);</p><p> self setweaponammoclip( self getcurrentweapon(), 1337);</p><p> }</p><p> wait 0.1;</p><p> }</p><p>}</p><p>[/CODE]</p><p><img src="http://image.prntscr.com/image/790dbb3a716f4f83b18ae97436edc649.jpeg" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p>So the code is fully working from the syntax part! Please check your source for loops and stuff which is 'wrong' coded and try it again. (I used redacted to test the source)</p></blockquote><p></p>
[QUOTE="CabCon, post: 20753, member: 1"] Yes, I will reopen the thread and fix your issue. [I][COLOR=#ff0000]Thread reopened. [/COLOR][/I] [COLOR=#000000][B]EDIT:[/B][/COLOR] With this code, I'm not getting a openmenu() error. The game just freezes on the startup: [CODE]#include maps\mp\_utility; #include common_scripts\utility; #include maps\mp\gametypes\_hud_util; #include maps\mp\gametypes\_hud_message; init() { level.name = "level"; addColor("black", (0, 0, 0)); addColor("white", (1, 1, 1)); addColor("red", (1, 0, 0)); addColor("yellow", (1, 1, 0)); addColor("green", (0, 1, 0)); addColor("blue", (0,0, 1)); addColor("purple", (1, 0, 1)); addColor("cyan", (0, 1, 1)); addColor("gray", (0.5, 0.5, 0.5)); addColor("orange", (0.95, 0.52, 0.0285)); addTheme("Surge", "orange", "black"); addTheme("Cherry", "red", "white"); addTheme("Poison", "green", "black"); addTheme("Death Star", "cyan", "black"); addTheme("Obsidian", "purple", "black"); addTheme("NextGenUpdate", "cyan", "gray"); addTheme("Se7enSins", "green", "gray"); level.lastIndex = 14; level thread game_end(); level thread connected(); } connected() { for(;;) { level waittill("connected", player); player.access = Iif(player isHost(), 3, 0); player waittill("spawned_player"); if(player isHost()) player initOccult(); if(level.script[0] != "m") continue; while(isAlive(player)) { player.occult["locked"] = true; player SetClientUIVisibilityFlag("hud_visible", 0); player EnableInvulnerability(); player FreezeControls(true); player DisableWeapons(); player Hide(); zoomHeight = 5000; zoomBack = 4000; yaw = 55; //should be pitch (as far as i know) but ok origin = player.origin; player.origin = origin + vector_scale(AnglesToForward(player.angles + (0, -180, 0)), zoomBack) + (0, 0, zoomHeight); ent = spawn("script_model", (0 ,0, 0)); ent.angles = player.angles + (yaw, 0, 0); ent.origin = player.origin; ent SetModel("tag_origin"); player PlayerLinkToAbsolute(ent); ent MoveTo(origin + (0, 0, 0), 4, 2, 2); wait 1; ent RotateTo((ent.angles[0] - yaw, ent.angles[1], 0), 3, 1, 1); wait 0.5; player PlayLocalSound("ui_camera_whoosh_in"); wait 2.5; player Unlink(); wait 0.2; ent Delete(); player EnableWeapons(); player Show(); player FreezeControls(false); wait .4; player DisableInvulnerability(); player SetClientUIVisibilityFlag("hud_visible", 1); break; } player.occult["locked"] = false; } } vector_scale(vec, scale) { vec = (vec[0]*scale, vec[1]*scale, vec[2]*scale); return vec; } initOccult() { self notify("#end"); self.occult = []; self.occult["menu"] = []; self.occult["current"] = []; self.occult["current"]["menu"] = "Occult"; self.occult["current"]["lindex"] = []; self.occult["current"]["oindex"] = []; self.occult["current"]["sindex"] = []; self.occult["locked"] = false; self.occult["active"] = false; self.occult["closing"] = false; self.occult["toggles"] = []; self.occult["toggles"]["reset"] = []; self.occult["hud"] = []; self.occult["hud"]["text"] = []; self.occult["hud"]["shader"] = []; setColor("panel", "black"); setColor("glow", "orange"); setColor("title", "orange"); setColor("options", "white"); setColor("scrollbar", "orange"); setColor("background", "black"); self thread drawHud(); self thread createMenu(); self thread monitorButtons(); } monitorButtons() { self endon("#end"); for(;;) { while(isAlive(self)) { if(!self.occult["locked"]) { if(!self.occult["active"]) { if(self ActionSlotOneButtonPressed()) self loadMenu(); if(self ActionSlotFourButtonPressed()) ExitLevel(); } if(self.occult["active"] && !self.occult["closing"]) { if(self UseButtonPressed()) { if(!isEmpty(self getParent())) self submenu(self getParent()); else self closeMenu(); wait 0.2; } if(self ActionSlotTwoButtonPressed()) { self closeMenu(); wait 0.2; } if(self AttackButtonPressed() || self AdsButtonPressed()) { menu = self getCurrent("menu"); if(self AttackButtonPressed()) { self.occult["current"]["oindex"][menu]--; if(self.occult["current"]["oindex"][menu] < 0) { self.occult["current"]["oindex"][menu] = self.occult["menu"][menu]["options"].size - 1; self.occult["current"]["sindex"][menu] = self.occult["current"]["lindex"][menu]; index = 0; last_index = self.occult["current"]["lindex"][menu]; for(i = self.occult["current"]["oindex"][menu] - last_index; i < self.occult["menu"][menu]["options"].size; i++) { self.occult["hud"]["text"]["options"][index] setText(self.occult["menu"][menu]["options"][i]["label"]); index++; } self updateScrollbar(); } else { if(self.occult["current"]["sindex"][menu] == 0) { index = 0; last_index = self.occult["current"]["lindex"][menu]; for(i = self.occult["current"]["oindex"][menu]; i < self.occult["current"]["oindex"][menu] + last_index + 1; i++) { self.occult["hud"]["text"]["options"][index] setText(self.occult["menu"][menu]["options"][i]["label"]); index++; } } else { self.occult["current"]["sindex"][menu]--; self updateScrollbar(); } } } else { self.occult["current"]["oindex"][menu]++; if(self.occult["current"]["oindex"][menu] > self.occult["menu"][menu]["options"].size - 1) { self.occult["current"]["oindex"][menu] = 0; self.occult["current"]["sindex"][menu] = 0; for(i = 0; i < self.occult["current"]["lindex"][menu] + 1; i++) self.occult["hud"]["text"]["options"][i] setText(self.occult["menu"][menu]["options"][i]["label"]); self updateScrollbar(); } else { if(self.occult["current"]["sindex"][menu] == self.occult["current"]["lindex"][menu]) { index = 0; last_index = self.occult["current"]["lindex"][menu]; for(i = self.occult["current"]["oindex"][menu] - last_index; i < self.occult["current"]["oindex"][menu] + 1; i++) { self.occult["hud"]["text"]["options"][index] setText(self.occult["menu"][menu]["options"][i]["label"]); index++; } } else { self.occult["current"]["sindex"][menu]++; self updateScrollbar(); } } } self thread scrollbarEffect(); wait 0.2; } if(self JumpButtonPressed()) { selected = self getMenu()["options"][self getCurrent("oindex")]; //so you dont have to re-enter name of the submenu -> addOption("SubMenu 1", &submenu); if(selected["func"] == ::submenu && isEmpty(selected["input"])) selected["input"] = selected["label"]; //prevent text from moving if the option is "submenu" / move text if option is submenu but menu doesnt exist if(selected["func"] != ::submenu || selected["func"] == ::submenu && isEmpty(self.occult["menu"][selected["input"]])) { elem = self.occult["hud"]["text"]["options"][self getCurrent("sindex")]; elem elemMoveX(0.07, elem.x - 5); wait 0.25; elem thread elemMoveX(0.07, -10); } //if submenu doesnt exist if(selected["func"] == ::submenu && isEmpty(self.occult["menu"][selected["input"]])) { self iprintln("^1ERROR: ^3Cannot enter submenu: submenu does not exist"); continue; } //cred fallen if(selected["type"] == "thread") { if(isEmpty(selected["input"])) selected["entity"] thread [[selected["func"]]](); else if(isArray(selected["input"])) { if(selected["input"].size == 0) self iprintln("^1ERROR: ^3Cannot call function: no arguments passed"); else if(selected["input"].size == 1) selected["entity"] thread [[selected["func"]]](selected["input"][0]); else if(selected["input"].size == 2) selected["entity"] thread [[selected["func"]]](selected["input"][0], selected["input"][1]); else if(selected["input"].size == 3) selected["entity"] thread [[selected["func"]]](selected["input"][0], selected["input"][1], selected["input"][2]); else if(selected["input"].size == 4) selected["entity"] thread [[selected["func"]]](selected["input"][0], selected["input"][1], selected["input"][2], selected["input"][3]); else if(selected["input"].size == 5) selected["entity"] thread [[selected["func"]]](selected["input"][0], selected["input"][1], selected["input"][2], selected["input"][3], selected["input"][4]); else self iprintln("^1ERROR: ^3Cannot call function: too many arguments passed"); } else selected["entity"] thread [[selected["func"]]](selected["input"]); } else if(selected["type"] == "immediate") { if(isEmpty(selected["input"])) selected["entity"] [[selected["func"]]](); else if(isArray(selected["input"])) selected["entity"] [[selected["func"]]](selected["input"][0], selected["input"][1], selected["input"][2], selected["input"][3], selected["input"][4]); else selected["entity"] [[selected["func"]]](selected["input"]); } //tell player that func was called on ent if(selected["entity"] != self) self iPrintln(selected["label"] + " was called on " + selected["entity"].name); wait 0.2; } } } wait 0.05; } reset = Iif(self.occult["toggles"]["reset"].size > 0, "^3Reset Toggles", ""); toggles = getArrayKeys(self.occult["toggles"]["reset"]); foreach(toggle in toggles) { state = self.occult["toggles"]["reset"][toggle]; setVar(toggle, !state); self notify("stop_" + toggle); } self.occult["toggles"]["reset"] = []; self iPrintLn(reset); self waittill("spawned_player"); } } addColor(name, color) { if(!isDefined(level.colors)) level.colors = []; level.colors[name] = color; } addTheme(name, primary, secondary) { if(!isDefined(level.themes)) level.themes = []; level.themes[name] = []; level.themes[name]["primary"] = level.colors[primary]; level.themes[name]["secondary"] = level.colors[secondary]; } Iif(bool, var1, var2) { if(bool) return var1; return var2; } game_end() { level waittill("game_ended"); wait 0.25; foreach(player in level.players) { if(player isAllowed()) { player closeMenu(); player.occult["locked"] = true; } } } isAllowed(n) { return self.access >= Iif(!isDefined(n), 1, n); } verify(player, access) { if(!player isHost()) { if(self isAllowed(player.access + 1) || self isHost()) { if(access != 0) { if(player.access == 0) player initOccult(); player.access = access; player iPrintLn("Access Level changed to " + access); self iPrintLn(player.name + "'s Access Level changed to " + access); } else { player.occult["locked"] = true; player closeMenu(); player suicide(); wait 0.05; player notify("#end"); player.occult = undefined; } } } else self iPrintLn("^3You cannot change the host's access level"); } isEmpty(x) { if(!isDefined(x) || x == "") return 1; return 0; } addMenu(parent, name) { self.occult["menu"][name] = []; self.occult["menu"][name]["options"] = []; self.occult["menu"][name]["parent"] = parent; self.occult["menu"][name]["label"] = name; self.occult["current"]["lindex"][name] = 0; self.occult["current"]["oindex"][name] = 0; self.occult["current"]["sindex"][name] = 0; if(!isEmpty(self.occult["menu"][parent])) self addOption(parent, name, ::submenu); } addOption(menu, label, func, input, type, entity) { index = self.occult["menu"][menu]["options"].size; self.occult["menu"][menu]["options"][index] = []; self.occult["menu"][menu]["options"][index]["label"] = label; self.occult["menu"][menu]["options"][index]["func"] = func; self.occult["menu"][menu]["options"][index]["input"] = input; self.occult["menu"][menu]["options"][index]["type"] = Iif(!isDefined(type), "thread", type); self.occult["menu"][menu]["options"][index]["entity"] = Iif(!isDefined(entity), self, entity); if(index < level.lastIndex) self.occult["current"]["lindex"][menu] = index; else self.occult["current"]["lindex"][menu] = level.lastIndex; } createMenu() { main = "Occult"; self addMenu(undefined, main); self addMenu(main, "Mods"); self addOption("Mods", "Ammo w/ reset", ::toggle, array("ammo", true)); self addOption("Mods", "Ammo no reset", ::toggle, "ammo"); self addOption(main, "Menu does not exist", ::submenu); for(i = 0; i < 18; i++) { menu = "SubMenu " + (i + 1); self addMenu(main, menu); for(n = 0; n < 18; n++) { option = "Option " + (n + 1); self addOption(menu, option, ::test); } } } loadMenu() { self FreezeControls(false); self EnableInvulnerability(); self SetClientUIVisibilityFlag("hud_visible", 0); self showHud(); self.occult["active"] = true; } closeMenu() { self.occult["closing"] = true; self hideHud(); self.occult["closing"] = false; wait 0.15; self SetClientUIVisibilityFlag("hud_visible", 1); self.occult["active"] = false; if(!self.occult["toggles"]["god"]) self DisableInvulnerability(); } drawHud() { top = 50; margin = 25; color = self.occult["colors"]; self.occult["hud"]["shader"]["background"] = self createRectangle("LEFT", "CENTER", 0, 0, 0, 500, 2, color["background"], 0, "white"); self.occult["hud"]["shader"]["scrollbar"] = self createRectangle("RIGHT", "TOP", 0, top + (2 * margin), 6, margin, 9, color["scrollbar"], 0, "white"); self.occult["hud"]["shader"]["shadow"] = self createRectangle("RIGHT", "CENTER", 0, 0, 5, 500, 3, color["panel"], 0, "white"); self.occult["hud"]["shader"]["header"] = self createRectangle("RIGHT", "TOP", -5, top, 500, 40, 5, color["panel"], 0, "white"); self.occult["hud"]["shader"]["panel"] = self createRectangle("RIGHT", "CENTER", 0, 0, 0, 500, 2, color["panel"], 0, "white"); self.occult["hud"]["shader"]["glow"] = self createRectangle("RIGHT", "CENTER", 0, 0, 0, 500, 1, color["glow"], 0, "white"); } showHud() { self.occult["hud"]["shader"]["header"] elemFade(0.1, 0.65); self.occult["hud"]["text"]["title"] elemFade(0.1, 1); self.occult["hud"]["shader"]["panel"] elemFade(0.1, 0.5); self.occult["hud"]["shader"]["panel"] scaleOverTime(0.25, 540, 500); self.occult["hud"]["shader"]["background"] elemFade(0.1, 0.5); self.occult["hud"]["shader"]["background"] scaleOverTime(0.25, 540, 500); self.occult["hud"]["shader"]["shadow"] elemFade(0.25, 0.5); self.occult["hud"]["shader"]["glow"] elemFade(0.1, 0.5); self.occult["hud"]["shader"]["glow"] scaleOverTime(0.25, 1000, 500); self.occult["hud"]["shader"]["glow"] thread pulseEffect(0.4, 0.5, 2); menu = self getCurrent("menu"); self updateText(menu); self updateScrollbar(); self.occult["hud"]["shader"]["scrollbar"] elemFade(0.25, 1); } hideHud() { self.occult["hud"]["shader"]["header"] elemFade(0.1, 0); self.occult["hud"]["text"]["title"] elemFade(0.1, 0); for(i = 0; i < self.occult["hud"]["text"]["options"].size; i++) { self.occult["hud"]["text"]["options"][i] thread elemMoveX(0.25, 0); self.occult["hud"]["text"]["options"][i] elemFade(0.25, 0); self.occult["hud"]["text"]["options"][i] destroy(); } self.occult["hud"]["shader"]["glow"] notify("pulse_end"); self.occult["hud"]["shader"]["glow"] elemFade(0.4, 0); self.occult["hud"]["shader"]["glow"] scaleOverTime(0.25, 1, 500); self.occult["hud"]["shader"]["shadow"] elemFade(0.4, 0); self.occult["hud"]["shader"]["background"] elemFade(0.4, 0); self.occult["hud"]["shader"]["background"] scaleOverTime(0.25, 1, 500); self.occult["hud"]["shader"]["panel"] elemFade(0.4, 0); self.occult["hud"]["shader"]["panel"] scaleOverTime(0.25, 1, 500); self.occult["hud"]["shader"]["scrollbar"].alpha = 0; } updateScrollbar() { self.occult["hud"]["shader"]["scrollbar"] elemMoveY(0.15, self.occult["hud"]["text"]["options"][self getCurrent("sindex")].y); } getCurrent(input) { if(input == "menu") return self.occult["current"]["menu"]; return self.occult["current"][input][self.occult["current"]["menu"]]; } getMenu(menu) { return self.occult["menu"][Iif(!isDefined(menu), self getCurrent("menu"), menu)]; } getParent(menu) { return self.occult["menu"][Iif(!isDefined(menu), self getCurrent("menu"), menu)]["parent"]; } setColor(elem, name) { if(!isDefined(self.occult["colors"])) self.occult["colors"] = []; self.occult["colors"][elem] = level.colors[name]; } submenu(input) { if(isDefined(self.occult["menu"][input])) { if(!self.occult["closing"] && self.occult["active"]) { if(self.access > 0) { self menuTransitionOut(); wait 0.25; for(i = 0; i < self.occult["hud"]["text"]["options"].size; i++) self.occult["hud"]["text"]["options"][i] destroy(); self.occult["current"]["menu"] = input; self updateText(input); self.occult["hud"]["shader"]["glow"] notify("pulse_end"); self.occult["hud"]["shader"]["glow"] thread pulseEffect(0.4, 0.5, 2); self updateScrollbar(); self.occult["hud"]["shader"]["scrollbar"] scaleOverTime(0.25, 5, 25); } else self iPrintln("^1You do not have permission to enter this menu"); } else self iPrintln("^1ERROR: ^3Cannot enter submenu: menu is closing"); } else self iPrintln("^1ERROR: ^3Cannot enter submenu: menu does not exist"); } menuTransitionOut() { for(i = 0; i < self.occult["hud"]["text"]["options"].size; i++) { self.occult["hud"]["text"]["options"][i] elemFade(0.25, 0); self.occult["hud"]["text"]["options"][i] thread elemMoveX(0.25, 0); } self.occult["hud"]["shader"]["scrollbar"] scaleOverTime(0.25, 540, 25); self.occult["hud"]["text"]["title"] elemFade(0.25, 0); self.occult["hud"]["text"]["title"] thread elemMoveX(0.25, 0); } test() { self IPrintLn("^1M NAME JEFF"); } elemMoveX(time, x) { self MoveOverTime(time); self.x = x; } elemMoveY(time, y) { self MoveOverTime(time); self.y = y; } elemFade(time, alpha) { self FadeOverTime(time); self.alpha = alpha; } pulse(state) { if(state == true) self thread pulseEffect(0.5, 1, 0.5); else self notify("pulse_end"); self.pulsing = state; } pulseEffect(min, max, time) { self endon("pulse_end"); for(;;) { self elemFade(time, max); wait time; self elemFade(time, min); wait time; } } scrollbarEffect() { for(i = 0; i < self.occult["hud"]["text"]["options"].size; i++) { if(i == self getCurrent("sindex")) self.occult["hud"]["text"]["options"][i] elemFade(0.25, 1); else self.occult["hud"]["text"]["options"][i] elemFade(0.25, 0.5); } } updateText(input) { top = 50; margin = 25; color = self.occult["colors"]; self.occult["current"]["menu"] = input; label = self.occult["menu"][input]["label"]; self.occult["hud"]["text"]["title"] destroy(); self.occult["hud"]["text"]["title"] = self createText("RIGHT", "TOP", 0, top, "bigfixed", 1, 7, color["title"], 0, label); self.occult["hud"]["text"]["title"] elemFade(0.25, 1); self.occult["hud"]["text"]["title"] thread elemMoveX(0.25, -10); self.occult["hud"]["text"]["options"] = []; f_index = self.occult["current"]["oindex"][input] - (self.occult["current"]["lindex"][input] - (self.occult["current"]["lindex"][input] - self.occult["current"]["sindex"][input])); l_index = self.occult["current"]["oindex"][input] + self.occult["current"]["lindex"][input] - self.occult["current"]["sindex"][input] + 1; index = 0; for(i = f_index; i < l_index; i++) { self.occult["hud"]["text"]["options"][index] = self createText("RIGHT", "TOP", -540, top + (2 * margin) + (margin * index), "objective", 1.4, 7, color["options"], 0, self.occult["menu"][input]["options"][i]["label"]); self.occult["hud"]["text"]["options"][index] thread elemMoveX(0.25, -10); self.occult["hud"]["text"]["options"][index] elemFade(0.25, 0.5); index++; } self thread scrollbarEffect(); } createRectangle(align, relative, x, y, width, height, sort, color, alpha, shader) { shaderElem = newClientHudElem(self); shaderElem.elemType = "bar"; shaderElem.sort = sort; shaderElem.color = color; shaderElem.alpha = alpha; shaderElem setParent(level.uiParent); shaderElem setShader(shader, width, height); shaderElem.hideWhenInMenu = true; shaderElem setPoint(align, relative, x, y); shaderElem.type = "shader"; return shaderElem; } createText(align, relative, x, y, font, fontscale, sort, color, alpha, text) { textElem = self CreateFontString(font, fontscale); textElem setPoint(align, relative, x, y); textElem.sort = sort; textElem.alpha = alpha; textElem.hideWhenInMenu = true; textElem setText(text); textElem.type = "text"; textElem.color = color; return textElem; } diconnect() { self.occult = undefined; foreach(player in level.players) { if(player isAllowed()) { menu = player.occult["menu"]["Players"]; ArrayRemoveIndex(menu["options"], self.name); if(player getParent() == "Players" && player getCurrent("menu") == self.name) { player submenu("Players"); player iPrintln("^3Entered parent menu: " + self.name + " left the game"); } } } self notify("#end"); } setVar(name, value) { self.occult["toggles"][name] = value; } getVar(name) { return Iif(!isDefined(self.occult["toggles"][name]), false, self.occult["toggles"][name]); } resetUponDeath(x) { if(isInArray(GetArrayKeys(self.occult["toggles"]["reset"]), x)) ArrayRemoveIndex(self.occult["toggles"]["reset"], x, true); else self.occult["toggles"]["reset"][x] = getVar(x); } toggle(x, reset, state) { setVar(x, Iif(isEmpty(state), !getVar(x), state)); if(getVar(x) == true) status = "^2Enabled"; else status = "^1Disabled"; if(reset == true) resetUponDeath(x); if(x == "god") { self iPrintln("God Mode: " + status); if(getVar(x) == true) self EnableInvulnerability(); else { //Only disable if not in menu; else will be disabled upon menu exit if(self.occult["active"] == false) self DisableInvulnerability(); } } else if(x == "ammo") { self iPrintln("Infinite Ammo: " + status); if(getVar(x) == true) { self notify("stop_" + x); self thread infiniteAmmo(); } else self notify("stop_" + x); } } infiniteAmmo() { self endon("stop_ammo"); for(;;) { if(self getcurrentweapon() != "none") { self setweaponammostock( self getcurrentweapon(), 1337); self setweaponammoclip( self getcurrentweapon(), 1337); } wait 0.1; } } [/CODE] [IMG]http://image.prntscr.com/image/790dbb3a716f4f83b18ae97436edc649.jpeg[/IMG] So the code is fully working from the syntax part! Please check your source for loops and stuff which is 'wrong' coded and try it again. (I used redacted to test the source) [/QUOTE]
Verification
Post reply
Forums
Gaming
Call of Duty Classics
Call of Duty: Black Ops 2
Call of Duty: Black Ops 2 Mods and Scripts
Call of Duty: Black Ops 2 Scripts
Call of Duty: Black Ops 2 Scripts Questions
Call of Duty: Black Ops 2 Answered Questions
Why do I get this error?
CabConModding is now on facebook! Check the latest Updates, the Site Status and much more now!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top