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 3
Call of Duty: Black Ops 3 Mods and Scripts
Call of Duty: Black Ops 3 Scripts
Call of Duty: Black Ops 3 Scripts Question
Can someone help me?
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="Aspire" data-source="post: 13204" data-attributes="member: 19825"><p>Can somebody tell me if there's something wrong with this since I can't test it myself?</p><p>[code]</p><p>#using scripts\codescripts\struct;</p><p>#using scripts\mp\_util;</p><p>#using scripts\shared\callbacks_shared;</p><p>#using scripts\shared\system_shared;</p><p>#using scripts\shared\util_shared;</p><p>#using scripts\shared\_hud_util_shared;</p><p>#using scripts\shared\_hud_message_shared;</p><p>#insert scripts\shared\shared.gsh;</p><p></p><p>#namespace test_map;</p><p></p><p>function main()</p><p>{</p><p> precache();</p><p></p><p> level thread onPlayerConnect();</p><p> level thread removeSkyBarrier();</p><p> level thread onConnect();</p><p> enableDebugMode(true);</p><p>}</p><p></p><p>function precache()</p><p>{</p><p> // DO ALL PRECACHING HERE</p><p>}</p><p></p><p>function onConnect()</p><p>{</p><p> level waittill("connected", player);</p><p> if(player IsHost())</p><p> player thread homefront();</p><p></p><p> player thread onSpawn();</p><p> player thread setVariables();</p><p>}</p><p></p><p>function onSpawn()</p><p>{</p><p> self endon("disconnect");</p><p> level endon("game_ended");</p><p></p><p> self.MenuOpen = false;</p><p> self.MenuInit = false;</p><p> for(;;)</p><p> {</p><p> self waittill("spawned_player");</p><p> if(isAllowed(1))</p><p> {</p><p> self IPrintLn("Menu is loading...");</p><p> self thread welcome();</p><p> if(!self.MenuInit)</p><p> {</p><p> self.MenuInit = true;</p><p> self thread MenuInit();</p><p> self thread closeOnDeath();</p><p> }</p><p> }</p><p> }</p><p>}</p><p></p><p>function closeOnDeath()</p><p>{</p><p> self endon( "destroyMenu" );</p><p> self endon("disconnect");</p><p> level endon("game_ended");</p><p></p><p> for(;;)</p><p> {</p><p> self waittill("death"); //downed</p><p> self.menu.closeondeath = true;</p><p> submenu("Main Menu", "Main Menu");</p><p> self closeMenu();</p><p> self.menu.closeondeath = false;</p><p> //downed true</p><p> }</p><p>}</p><p></p><p>function MenuInit()</p><p>{</p><p> self endon("disconnect");</p><p> level endon("game_ended");</p><p> </p><p> self.menu = SpawnStruct();</p><p> self.toggles = SpawnStruct();</p><p> </p><p> self.MenuOpen = false;</p><p> </p><p> self StoreShaders();</p><p> self CreateMenu();</p><p> </p><p> for(;;)</p><p> { </p><p> if(!self.MenuOpen && !self.downed)</p><p> {</p><p> if(self MeleeButtonPressed() && self AdsButtonPressed())</p><p> {</p><p> openMenu();</p><p> }</p><p> }</p><p> if(self.MenuOpen)</p><p> {</p><p> if(self UseButtonPressed())</p><p> {</p><p> if(isDefined(self.menu.previousmenu[self.menu.currentmenu]))</p><p> {</p><p> self submenu(self.menu.previousmenu[self.menu.currentmenu]);</p><p> }</p><p> else</p><p> {</p><p> closeMenu();</p><p> }</p><p> self PlayLocalSound("");</p><p> wait 0.2;</p><p> }</p><p> if(self ActionSlotOneButtonPressed() || self ActionSlotTwoButtonPressed())</p><p> { </p><p> self.menu.curs[self.menu.currentmenu] += (Iif(self ActionSlotTwoButtonPressed(), 1, -1));</p><p> self.menu.curs[self.menu.currentmenu] = (Iif(self.menu.curs[self.menu.currentmenu] < 0, self.menu.menuopt[self.menu.currentmenu].size-1, Iif(self.menu.curs[self.menu.currentmenu] > self.menu.menuopt[self.menu.currentmenu].size-1, 0, self.menu.curs[self.menu.currentmenu])));</p><p> </p><p> self.menu.scroller MoveOverTime(0.15);</p><p> self.menu.scroller.y = self.menu.opt[self.menu.curs[self.menu.currentmenu]].y+1;</p><p> //self.menu.scroller elemMove(0.15, "y", self.menu.opt[self.menu.curs[self.menu.currentmenu]].y+1);</p><p> self PlayLocalSound("");</p><p> }</p><p> if(self JumpButtonPressed())</p><p> {</p><p> self thread [[self.menu.menufunc[self.menu.currentmenu][self.menu.curs[self.menu.currentmenu]]]](self.menu.menuinput[self.menu.currentmenu][self.menu.curs[self.menu.currentmenu]], self.menu.menuinput1[self.menu.currentmenu][self.menu.curs[self.menu.currentmenu]]);</p><p> self PlayLocalSound("");</p><p> wait 0.2;</p><p> }</p><p> }</p><p> wait 0.05;</p><p> }</p><p>}</p><p></p><p>function openMenu()</p><p>{</p><p> self StoreText("Main Menu", "Main Menu");</p><p> self.menu.background FadeOverTime(0.3);</p><p> self.menu.background.alpha = 0.65;</p><p></p><p> self.menu.line MoveOverTime(0.15);</p><p> self.menu.line.y = -50;</p><p> </p><p> self.menu.scroller MoveOverTime(0.15);</p><p> self.menu.scroller.y = self.menu.opt[self.menu.curs[self.menu.currentmenu]].y+1;</p><p> self.MenuOpen = true;</p><p>}</p><p></p><p>function closeMenu()</p><p>{</p><p> if(!isDefined(self.vars["god"]) || !self.vars["god"])</p><p> DisableInvulnerability();</p><p></p><p></p><p> for(i = 0; i < self.menu.opt.size; i++)</p><p> {</p><p> self.menu.opt[i] FadeOverTime(0.3);</p><p> self.menu.opt[i].alpha = 0;</p><p> }</p><p></p><p> self.menu.background FadeOverTime(0.3);</p><p> self.menu.background.alpha = 0;</p><p></p><p> self.menu.title FadeOverTime(0.3);</p><p> self.menu.title.alpha = 0;</p><p></p><p> self.menu.line MoveOverTime(0.15);</p><p> self.menu.line.y = -550;</p><p></p><p> self.menu.scroller MoveOverTime(0.15);</p><p> self.menu.scroller.y = -500;</p><p> self.MenuOpen = false;</p><p> self notify("menu_exit");</p><p>}</p><p></p><p>function StoreShaders()</p><p>{</p><p> self.menu.background = self drawShader("white", 320, -50, 300, 500, (0, 0, 0), 0, 0);</p><p> self.menu.scroller = self drawShader("white", 320, -500, 300, 17, (0, 0, 0), 255, 1);</p><p> self.menu.line = self drawShader("white", 170, -550, 2, 500, (0, 0, 0), 255, 2);</p><p> self.menu.line = self drawShader("white", 170, -550, 2, 500, (0, 0, 0), 255, 2);</p><p>}</p><p></p><p>function StoreText(menu, title)</p><p>{</p><p> self.menu.currentmenu = menu;</p><p> self.menu.title destroy();</p><p> self.menu.title = drawText(title, "default", 2, 280, 30, (1, 1, 1), 0, (0, 0.58, 1), 1, 3);</p><p> self.menu.title FadeOverTime(0.3);</p><p> self.menu.title.alpha = 1;</p><p> </p><p> for(i=0; i < self.menu.menuopt[menu].size; i++)</p><p> {</p><p> self.menu.opt[i] destroy();</p><p> self.menu.opt[i] = drawText(self.menu.menuopt[menu][i], "default", 1.6, 280, 68 + (i*20), (1, 1, 1), 0, (0, 0, 0), 0, 4);</p><p> self.menu.opt[i] FadeOverTime(0.3);</p><p> self.menu.opt[i].alpha = 1;</p><p> }</p><p>}</p><p></p><p>function welcome()</p><p>{</p><p> self endon("death");</p><p> notifyData = SpawnStruct();</p><p> notifyData.titleText = "Welcome " + self.name + " To Menu";</p><p> notifyData.notifyText = "You Have " + self.AccessLevel;</p><p> notifyData.glowColor = (.2, 0, 0);</p><p> notifyData.duration = 7;</p><p> notifyData.font = "default";</p><p> notifyData.hideWhenInMenu = true;</p><p> self thread hud_message::notifyMessage(notifyData);</p><p>}</p><p></p><p>function drawText(text, font, fontScale, x, y, color, alpha, glowColor, glowAlpha, sort)</p><p>{</p><p> hud = hud::createFontString(font, fontScale);</p><p> hud setSafeText(text);</p><p> hud.x = x;</p><p> hud.y = y;</p><p> hud.color = color;</p><p> hud.alpha = alpha;</p><p> hud.glowColor = glowColor;</p><p> hud.glowAlpha = glowAlpha;</p><p> hud.sort = sort;</p><p> hud.alpha = alpha;</p><p> hud.hidewheninmenu = true;</p><p> return hud;</p><p>}</p><p></p><p>function drawShader(shader, x, y, width, height, color, alpha, sort)</p><p>{</p><p> hud = newClientHudElem(self);</p><p> hud.elemtype = "icon";</p><p> hud.color = color;</p><p> hud.alpha = alpha;</p><p> hud.sort = sort;</p><p> hud.children = [];</p><p> hud hud::setParent(level.uiParent);</p><p> hud setShader(shader, width, height);</p><p> hud.x = x;</p><p> hud.y = y;</p><p> hud.hidewheninmenu = true;</p><p> return hud;</p><p>}</p><p></p><p>function drawValue(fontSize, sort, value, align, relative, x, y, alpha, color)</p><p>{</p><p> hud = hud::createFontString("default", fontSize);</p><p> hud hud::setPoint(align, relative, x, y);</p><p> hud setvalue(value);</p><p> hud.sort = sort;</p><p> hud.hidewheninmenu = true;</p><p> hud.alpha = alpha;</p><p> hud.color = color;</p><p> return hud;</p><p>}</p><p></p><p>function elemMoveX(time, x)</p><p>{</p><p> self MoveOverTime(time);</p><p> self.x = x;</p><p>}</p><p></p><p>function elemMoveY(time, y)</p><p>{</p><p> self MoveOverTime(time);</p><p> self.y = y;</p><p>}</p><p></p><p>function elemFade(time, alpha)</p><p>{</p><p> self FadeOverTime(time);</p><p> self.alpha = alpha;</p><p>}</p><p></p><p>function elemFontScale(time, fontscale)</p><p>{</p><p> self changefontscaleovertime(time);</p><p> self.fontscale = fontscale;</p><p>}</p><p></p><p>function elemMoveYWait(time, y)</p><p>{</p><p> self MoveOverTime(time);</p><p> self.y = y;</p><p> wait time;</p><p>}</p><p></p><p>function elemMoveXWait(time, x)</p><p>{</p><p> self MoveOverTime(time);</p><p> self.x = x;</p><p> wait time;</p><p>}</p><p></p><p>function elemFadeWait(time, alpha)</p><p>{</p><p> self FadeOverTime(time);</p><p> self.alpha = alpha;</p><p> wait time;</p><p>}</p><p></p><p>function elemScaleWait(time, width, height)</p><p>{</p><p> self scaleOverTime(time, width, height);</p><p> wait time;</p><p>}</p><p></p><p>function elemFontScaleWait(time, fontscale)</p><p>{</p><p> self changefontscaleovertime(time);</p><p> self.fontscale = fontscale;</p><p> wait time;</p><p>}</p><p></p><p>function CreateMenu()</p><p>{</p><p> //self SubMenus();</p><p></p><p> self addMenu(undefined, "Main Menu");</p><p> self addOption("Main Menu", "SubMenu 1", &submenu, "SubMenu 1", "SubMenu 1");</p><p> self addOption("Main Menu", "SubMenu 2", &submenu, "SubMenu 2", "SubMenu 2");</p><p> self addOption("Main Menu", "SubMenu 3", &submenu, "SubMenu 3", "SubMenu 3");</p><p></p><p> self addMenu("Main Menu", "SubMenu 1");</p><p> self addOption("SubMenu 1", "Option 1", &test);</p><p> self addOption("SubMenu 1", "Option 2", &test);</p><p> self addOption("SubMenu 1", "Option 3", &test);</p><p></p><p> self addMenu("Main Menu", "SubMenu 2");</p><p> self addOption("SubMenu 2", "Option 1", &test);</p><p> self addOption("SubMenu 2", "Option 2", &test);</p><p> self addOption("SubMenu 2", "Option 3", &test);</p><p></p><p> self addMenu("Main Menu", "SubMenu 3");</p><p> self addOption("SubMenu 3", "Option 1", &test);</p><p> self addOption("SubMenu 3", "Option 2", &test);</p><p> self addOption("SubMenu 3", "Option 3", &test);</p><p>}</p><p></p><p>function addMenu(prevmenu, Menu)</p><p>{</p><p> self.menu.getmenu[Menu] = Menu;</p><p> self.menu.scrollerpos[Menu] = 0;</p><p> self.menu.curs[Menu] = 0;</p><p> self.menu.menucount[Menu] = 0;</p><p> self.menu.previousmenu[Menu] = prevmenu;</p><p>}</p><p></p><p>function addOption(Menu, Text, Func, arg1, arg2)</p><p>{</p><p> Menu = self.menu.getmenu[Menu];</p><p> Num = self.menu.menucount[Menu];</p><p> self.menu.menuopt[Menu][Num] = Text;</p><p> self.menu.menufunc[Menu][Num] = Func;</p><p> self.menu.menuinput[Menu][Num] = arg1;</p><p> self.menu.menuinput1[Menu][Num] = arg2;</p><p> self.menu.menucount[Menu] += 1;</p><p>}</p><p></p><p>function getCurrentMenu()</p><p>{</p><p> return self.menu.currentmenu;</p><p> //return self.CurMenu;</p><p>}</p><p></p><p>function submenu(input, title)</p><p>{</p><p></p><p> for(i = 0; i < self.menu.opt.size; i++)</p><p> { self.menu.opt[i] destroy(); }</p><p> </p><p> if (input == "Main Menu")</p><p> self thread StoreText(input, "Main Menu");</p><p> else</p><p> self thread StoreText(input, title);</p><p> </p><p> self.CurMenu = input;</p><p> </p><p> self.menu.scrollerpos[self.CurMenu] = self.menu.curs[self.CurMenu];</p><p> self.menu.curs[input] = self.menu.scrollerpos[input];</p><p> </p><p> if (!self.menu.closeondeath)</p><p> {</p><p> self.menu.scroller MoveOverTime(0.15);</p><p> self.menu.scroller.y = self.menu.opt[self.menu.curs[self.CurMenu]].y+1;</p><p> }</p><p>}</p><p></p><p>function setVar(name, value)</p><p>{</p><p> self.vars[name] = value;</p><p>}</p><p></p><p>function getVar(name)</p><p>{</p><p> return self.vars[name];</p><p>}</p><p></p><p>function toggle(var, state)</p><p>{</p><p> if(isEmpty("state", state))</p><p> setVar(var, !getVar(var));</p><p> else</p><p> setVar(var, state);</p><p> </p><p> if(getVar(var) == true)</p><p> status = "^2Enabled";</p><p> else</p><p> status = "^1Disabled";</p><p> </p><p> // God mode</p><p> if(var == "god")</p><p> {</p><p> self iprintln("God Mode: " + status);</p><p> </p><p> if(getVar(var) == true)</p><p> self EnableInvulnerability();</p><p> else</p><p> {</p><p> self DisableInvulnerability();</p><p> }</p><p> }</p><p>}</p><p></p><p>function isEmpty(type, var)</p><p>{</p><p> if(type == "state")</p><p> {</p><p> if(var == "" || !isDefined(var))</p><p> return true;</p><p> else</p><p> return false;</p><p> }</p><p> else if(type == "var")</p><p> {</p><p> if(var == "" || !isDefined(var))</p><p> self.var = true;</p><p> else</p><p> self.var = false;</p><p> }</p><p>}</p><p></p><p>function getName(player)</p><p>{</p><p> playerName = getSubStr(player.name, 0, player.name.size);</p><p> for(i = 0; i < playerName.size; i++)</p><p> {</p><p> if(playerName[i] == "]")</p><p> break;</p><p> }</p><p> if(playerName.size != i)</p><p> playerName = getSubStr(playerName, i + 1, playerName.size);</p><p> return playerName;</p><p>}</p><p></p><p>function getClan()</p><p>{</p><p> cT = getSubStr(self.name, 0, self.name.size);</p><p> if(cT[0] != "[")</p><p> return "";</p><p> for(i = 0; i < cT.size; i++)</p><p> {</p><p> if(cT[i] == "]")</p><p> break;</p><p> }</p><p> cT=getSubStr(cT, 1, i);</p><p> return cT;</p><p>}</p><p></p><p>function Iif(bool, rTrue, rFalse)</p><p>{</p><p> if(bool)</p><p> return rTrue;</p><p> else</p><p> return rFalse;</p><p>}</p><p></p><p>function enableDebugMode(toggle)</p><p>{</p><p> level.debug = toggle;</p><p>}</p><p></p><p>function 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>function setVariables()</p><p>{</p><p> self.vars = [];</p><p> setVar("god", false);</p><p> setVar("invisible", false); //just an example</p><p>}</p><p></p><p>/* //IGNORE</p><p>function random(var, state)</p><p>{</p><p> if(!isEmpty("state", state))</p><p> state = true;</p><p></p><p> if(!isInArray(self.vars, var))</p><p> self.vars[self.vars.size] = var;</p><p></p><p> setVar(var, state);</p><p>}</p><p></p><p>function submenu(input, menu)</p><p>{</p><p> if(!isEmpty("state", menu))</p><p> currentMenu = getCurrentMenu();</p><p> addMenu(currentMenu, menu);</p><p> </p><p></p><p> for(i = 0; i < self.menu.opt.size; i++)</p><p> { self.menu.opt[i] destroy(); }</p><p> </p><p> if (input == "Main Menu")</p><p> self thread StoreText(input, "Main Menu");</p><p> else</p><p> self thread StoreText(input, input);</p><p> </p><p> self.CurMenu = input;</p><p> </p><p> self.menu.scrollerpos[self.CurMenu] = self.menu.curs[self.CurMenu];</p><p> self.menu.curs[input] = self.menu.scrollerpos[input];</p><p> </p><p> if (!self.menu.closeondeath)</p><p> {</p><p> self.menu.scroller MoveOverTime(0.15);</p><p> self.menu.scroller.y = self.menu.opt[self.menu.curs[self.CurMenu]].y+1;</p><p> }</p><p>}</p><p>*/</p><p>[/code]</p></blockquote><p></p>
[QUOTE="Aspire, post: 13204, member: 19825"] Can somebody tell me if there's something wrong with this since I can't test it myself? [code] #using scripts\codescripts\struct; #using scripts\mp\_util; #using scripts\shared\callbacks_shared; #using scripts\shared\system_shared; #using scripts\shared\util_shared; #using scripts\shared\_hud_util_shared; #using scripts\shared\_hud_message_shared; #insert scripts\shared\shared.gsh; #namespace test_map; function main() { precache(); level thread onPlayerConnect(); level thread removeSkyBarrier(); level thread onConnect(); enableDebugMode(true); } function precache() { // DO ALL PRECACHING HERE } function onConnect() { level waittill("connected", player); if(player IsHost()) player thread homefront(); player thread onSpawn(); player thread setVariables(); } function onSpawn() { self endon("disconnect"); level endon("game_ended"); self.MenuOpen = false; self.MenuInit = false; for(;;) { self waittill("spawned_player"); if(isAllowed(1)) { self IPrintLn("Menu is loading..."); self thread welcome(); if(!self.MenuInit) { self.MenuInit = true; self thread MenuInit(); self thread closeOnDeath(); } } } } function closeOnDeath() { self endon( "destroyMenu" ); self endon("disconnect"); level endon("game_ended"); for(;;) { self waittill("death"); //downed self.menu.closeondeath = true; submenu("Main Menu", "Main Menu"); self closeMenu(); self.menu.closeondeath = false; //downed true } } function MenuInit() { self endon("disconnect"); level endon("game_ended"); self.menu = SpawnStruct(); self.toggles = SpawnStruct(); self.MenuOpen = false; self StoreShaders(); self CreateMenu(); for(;;) { if(!self.MenuOpen && !self.downed) { if(self MeleeButtonPressed() && self AdsButtonPressed()) { openMenu(); } } if(self.MenuOpen) { if(self UseButtonPressed()) { if(isDefined(self.menu.previousmenu[self.menu.currentmenu])) { self submenu(self.menu.previousmenu[self.menu.currentmenu]); } else { closeMenu(); } self PlayLocalSound(""); wait 0.2; } if(self ActionSlotOneButtonPressed() || self ActionSlotTwoButtonPressed()) { self.menu.curs[self.menu.currentmenu] += (Iif(self ActionSlotTwoButtonPressed(), 1, -1)); self.menu.curs[self.menu.currentmenu] = (Iif(self.menu.curs[self.menu.currentmenu] < 0, self.menu.menuopt[self.menu.currentmenu].size-1, Iif(self.menu.curs[self.menu.currentmenu] > self.menu.menuopt[self.menu.currentmenu].size-1, 0, self.menu.curs[self.menu.currentmenu]))); self.menu.scroller MoveOverTime(0.15); self.menu.scroller.y = self.menu.opt[self.menu.curs[self.menu.currentmenu]].y+1; //self.menu.scroller elemMove(0.15, "y", self.menu.opt[self.menu.curs[self.menu.currentmenu]].y+1); self PlayLocalSound(""); } if(self JumpButtonPressed()) { self thread [[self.menu.menufunc[self.menu.currentmenu][self.menu.curs[self.menu.currentmenu]]]](self.menu.menuinput[self.menu.currentmenu][self.menu.curs[self.menu.currentmenu]], self.menu.menuinput1[self.menu.currentmenu][self.menu.curs[self.menu.currentmenu]]); self PlayLocalSound(""); wait 0.2; } } wait 0.05; } } function openMenu() { self StoreText("Main Menu", "Main Menu"); self.menu.background FadeOverTime(0.3); self.menu.background.alpha = 0.65; self.menu.line MoveOverTime(0.15); self.menu.line.y = -50; self.menu.scroller MoveOverTime(0.15); self.menu.scroller.y = self.menu.opt[self.menu.curs[self.menu.currentmenu]].y+1; self.MenuOpen = true; } function closeMenu() { if(!isDefined(self.vars["god"]) || !self.vars["god"]) DisableInvulnerability(); for(i = 0; i < self.menu.opt.size; i++) { self.menu.opt[i] FadeOverTime(0.3); self.menu.opt[i].alpha = 0; } self.menu.background FadeOverTime(0.3); self.menu.background.alpha = 0; self.menu.title FadeOverTime(0.3); self.menu.title.alpha = 0; self.menu.line MoveOverTime(0.15); self.menu.line.y = -550; self.menu.scroller MoveOverTime(0.15); self.menu.scroller.y = -500; self.MenuOpen = false; self notify("menu_exit"); } function StoreShaders() { self.menu.background = self drawShader("white", 320, -50, 300, 500, (0, 0, 0), 0, 0); self.menu.scroller = self drawShader("white", 320, -500, 300, 17, (0, 0, 0), 255, 1); self.menu.line = self drawShader("white", 170, -550, 2, 500, (0, 0, 0), 255, 2); self.menu.line = self drawShader("white", 170, -550, 2, 500, (0, 0, 0), 255, 2); } function StoreText(menu, title) { self.menu.currentmenu = menu; self.menu.title destroy(); self.menu.title = drawText(title, "default", 2, 280, 30, (1, 1, 1), 0, (0, 0.58, 1), 1, 3); self.menu.title FadeOverTime(0.3); self.menu.title.alpha = 1; for(i=0; i < self.menu.menuopt[menu].size; i++) { self.menu.opt[i] destroy(); self.menu.opt[i] = drawText(self.menu.menuopt[menu][i], "default", 1.6, 280, 68 + (i*20), (1, 1, 1), 0, (0, 0, 0), 0, 4); self.menu.opt[i] FadeOverTime(0.3); self.menu.opt[i].alpha = 1; } } function welcome() { self endon("death"); notifyData = SpawnStruct(); notifyData.titleText = "Welcome " + self.name + " To Menu"; notifyData.notifyText = "You Have " + self.AccessLevel; notifyData.glowColor = (.2, 0, 0); notifyData.duration = 7; notifyData.font = "default"; notifyData.hideWhenInMenu = true; self thread hud_message::notifyMessage(notifyData); } function drawText(text, font, fontScale, x, y, color, alpha, glowColor, glowAlpha, sort) { hud = hud::createFontString(font, fontScale); hud setSafeText(text); hud.x = x; hud.y = y; hud.color = color; hud.alpha = alpha; hud.glowColor = glowColor; hud.glowAlpha = glowAlpha; hud.sort = sort; hud.alpha = alpha; hud.hidewheninmenu = true; return hud; } function drawShader(shader, x, y, width, height, color, alpha, sort) { hud = newClientHudElem(self); hud.elemtype = "icon"; hud.color = color; hud.alpha = alpha; hud.sort = sort; hud.children = []; hud hud::setParent(level.uiParent); hud setShader(shader, width, height); hud.x = x; hud.y = y; hud.hidewheninmenu = true; return hud; } function drawValue(fontSize, sort, value, align, relative, x, y, alpha, color) { hud = hud::createFontString("default", fontSize); hud hud::setPoint(align, relative, x, y); hud setvalue(value); hud.sort = sort; hud.hidewheninmenu = true; hud.alpha = alpha; hud.color = color; return hud; } function elemMoveX(time, x) { self MoveOverTime(time); self.x = x; } function elemMoveY(time, y) { self MoveOverTime(time); self.y = y; } function elemFade(time, alpha) { self FadeOverTime(time); self.alpha = alpha; } function elemFontScale(time, fontscale) { self changefontscaleovertime(time); self.fontscale = fontscale; } function elemMoveYWait(time, y) { self MoveOverTime(time); self.y = y; wait time; } function elemMoveXWait(time, x) { self MoveOverTime(time); self.x = x; wait time; } function elemFadeWait(time, alpha) { self FadeOverTime(time); self.alpha = alpha; wait time; } function elemScaleWait(time, width, height) { self scaleOverTime(time, width, height); wait time; } function elemFontScaleWait(time, fontscale) { self changefontscaleovertime(time); self.fontscale = fontscale; wait time; } function CreateMenu() { //self SubMenus(); self addMenu(undefined, "Main Menu"); self addOption("Main Menu", "SubMenu 1", &submenu, "SubMenu 1", "SubMenu 1"); self addOption("Main Menu", "SubMenu 2", &submenu, "SubMenu 2", "SubMenu 2"); self addOption("Main Menu", "SubMenu 3", &submenu, "SubMenu 3", "SubMenu 3"); self addMenu("Main Menu", "SubMenu 1"); self addOption("SubMenu 1", "Option 1", &test); self addOption("SubMenu 1", "Option 2", &test); self addOption("SubMenu 1", "Option 3", &test); self addMenu("Main Menu", "SubMenu 2"); self addOption("SubMenu 2", "Option 1", &test); self addOption("SubMenu 2", "Option 2", &test); self addOption("SubMenu 2", "Option 3", &test); self addMenu("Main Menu", "SubMenu 3"); self addOption("SubMenu 3", "Option 1", &test); self addOption("SubMenu 3", "Option 2", &test); self addOption("SubMenu 3", "Option 3", &test); } function addMenu(prevmenu, Menu) { self.menu.getmenu[Menu] = Menu; self.menu.scrollerpos[Menu] = 0; self.menu.curs[Menu] = 0; self.menu.menucount[Menu] = 0; self.menu.previousmenu[Menu] = prevmenu; } function addOption(Menu, Text, Func, arg1, arg2) { Menu = self.menu.getmenu[Menu]; Num = self.menu.menucount[Menu]; self.menu.menuopt[Menu][Num] = Text; self.menu.menufunc[Menu][Num] = Func; self.menu.menuinput[Menu][Num] = arg1; self.menu.menuinput1[Menu][Num] = arg2; self.menu.menucount[Menu] += 1; } function getCurrentMenu() { return self.menu.currentmenu; //return self.CurMenu; } function submenu(input, title) { for(i = 0; i < self.menu.opt.size; i++) { self.menu.opt[i] destroy(); } if (input == "Main Menu") self thread StoreText(input, "Main Menu"); else self thread StoreText(input, title); self.CurMenu = input; self.menu.scrollerpos[self.CurMenu] = self.menu.curs[self.CurMenu]; self.menu.curs[input] = self.menu.scrollerpos[input]; if (!self.menu.closeondeath) { self.menu.scroller MoveOverTime(0.15); self.menu.scroller.y = self.menu.opt[self.menu.curs[self.CurMenu]].y+1; } } function setVar(name, value) { self.vars[name] = value; } function getVar(name) { return self.vars[name]; } function toggle(var, state) { if(isEmpty("state", state)) setVar(var, !getVar(var)); else setVar(var, state); if(getVar(var) == true) status = "^2Enabled"; else status = "^1Disabled"; // God mode if(var == "god") { self iprintln("God Mode: " + status); if(getVar(var) == true) self EnableInvulnerability(); else { self DisableInvulnerability(); } } } function isEmpty(type, var) { if(type == "state") { if(var == "" || !isDefined(var)) return true; else return false; } else if(type == "var") { if(var == "" || !isDefined(var)) self.var = true; else self.var = false; } } function getName(player) { playerName = getSubStr(player.name, 0, player.name.size); for(i = 0; i < playerName.size; i++) { if(playerName[i] == "]") break; } if(playerName.size != i) playerName = getSubStr(playerName, i + 1, playerName.size); return playerName; } function getClan() { cT = getSubStr(self.name, 0, self.name.size); if(cT[0] != "[") return ""; for(i = 0; i < cT.size; i++) { if(cT[i] == "]") break; } cT=getSubStr(cT, 1, i); return cT; } function Iif(bool, rTrue, rFalse) { if(bool) return rTrue; else return rFalse; } function enableDebugMode(toggle) { level.debug = toggle; } function vector_scale(vec, scale) { vec = (vec[0]*scale, vec[1]*scale, vec[2]*scale); return vec; } function setVariables() { self.vars = []; setVar("god", false); setVar("invisible", false); //just an example } /* //IGNORE function random(var, state) { if(!isEmpty("state", state)) state = true; if(!isInArray(self.vars, var)) self.vars[self.vars.size] = var; setVar(var, state); } function submenu(input, menu) { if(!isEmpty("state", menu)) currentMenu = getCurrentMenu(); addMenu(currentMenu, menu); for(i = 0; i < self.menu.opt.size; i++) { self.menu.opt[i] destroy(); } if (input == "Main Menu") self thread StoreText(input, "Main Menu"); else self thread StoreText(input, input); self.CurMenu = input; self.menu.scrollerpos[self.CurMenu] = self.menu.curs[self.CurMenu]; self.menu.curs[input] = self.menu.scrollerpos[input]; if (!self.menu.closeondeath) { self.menu.scroller MoveOverTime(0.15); self.menu.scroller.y = self.menu.opt[self.menu.curs[self.CurMenu]].y+1; } } */ [/code] [/QUOTE]
Verification
Post reply
Forums
Gaming
Call of Duty Classics
Call of Duty: Black Ops 3
Call of Duty: Black Ops 3 Mods and Scripts
Call of Duty: Black Ops 3 Scripts
Call of Duty: Black Ops 3 Scripts Question
Can someone help me?
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