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: Warzone
[CoD:MW (2019)] GSC Managed code list
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="JayCoder" data-source="post: 63755" data-attributes="member: 11522"><p>it's like it's your first time making gsc ... like u came from a c-language, like c++ or c# possibly,</p><p>I'v not seen people really do case, breaking for menu's since waw and myself tho it's not a really officiant way....</p><p>and i think ur using iprintln for the text structure which is weird ... just use setText... unless u can't for cod mw,</p><p>it certain cases case breaking is good, but ur making a menu not a toggle or a function... so it's just gunna cause more code, script.</p><p></p><p>u could use this example:</p><p></p><p>function look up information:</p><p>[CODE=cpp]void <hud_element> SetText(<text>)</p><p>[MANDATORY] <text> A localized text reference</p><p>CATEGORY: UI</p><p>CLIENT/SERVER: Server</p><p>SUMMARY: Set HUD text for this element.</p><p>EXAMPLE: level.introstring1 SetText(string1)</p><p></p><p>testfunction()</p><p>{</p><p> self thread mytextExample(0.5,"menu name");</p><p>}</p><p></p><p>mytextExample(Time,MenuTitle)</p><p>{</p><p> self.mytext = [];</p><p> self.mytextSet = self hud::CreateFontString("default", "1");</p><p> self.mytextSet.alpha = 1;</p><p> text_spacing_x = 10;</p><p> for(i=0;i<10;i++)</p><p> {</p><p> //varibles</p><p> self.mytextSet["example_sub"+i].hideWhenInMenu = true;</p><p> self.mytextSet["example_title"].hideWhenInMenu = true;</p><p> self.mytextSet["example_title"].sort = 0; </p><p> self.mytextSet["example_sub"+i].sort = i;</p><p> self.mytextSet["example_sub"+i] hud::setPoint("CENTER", "CENTER", 0, text_spacing_x * i);</p><p> self.mytextSet["example_title"] hud::setPoint("CENTER", "CENTER", 0, 0);</p><p> //Structure</p><p> self.mytextSet["example_title"] SetText(MenuTitle);</p><p> self.mytextSet["example_sub"+i] SetText("Sub Option: " + i);</p><p> //Color</p><p> textElem.color = (1,1,1);</p><p> wait time;</p><p> }</p><p> wait time;</p><p> return self.mytextSet;</p><p>}</p><p></p><p>//menu would look something like this possibly</p><p></p><p>/*</p><p></p><p>menu name</p><p></p><p>sub option: 1</p><p>sub option: 2</p><p>sub option: 3</p><p>sub option: 4</p><p>sub option: 5</p><p>sub option: 6</p><p>sub option: 7</p><p>sub option: 8</p><p>sub option: 9</p><p>sub option: 10</p><p></p><p>*/</p><p>[/CODE]</p><p></p><p>I don't know if that example works, but it should, if I we're creating text on cod mw that is something i would do possibly..</p><p></p><p>this is a super simple example for creating text as u can see,</p><p>I take the variable I and it 10 times using a for loop</p><p>and also make a title without the I so it doesn't make multiple titles,</p><p>then use it for the subtext to make a structure, by putting it into an array.</p><p></p><p>it just looks like c++ code,</p><p>[CODE=cpp] case "ModMenuOpenDescription":</p><p> if ( selfLang == level.MODDEF.LN_EN ) { return "^3Give random weapon to press^1 [{+speed_throw}] + [{+melee}] ^3."; }</p><p> else if ( selfLang == level.MODDEF.LN_JA ) { return "^3ランダム武器は^1 [{+speed_throw}] + [{+melee}] ^3で取得できます。"; }</p><p> else if ( selfLang == level.MODDEF.LN_CN ) { return "^3随机武器^1 [{+speed_throw}] + [{+melee}] ^3你可以得到。"; }</p><p> else if ( selfLang == level.MODDEF.LN_RU ) { return "^3случайное оружие ^1 [{+speed_throw}] + [{+melee}] ^3вы можете получить."; }</p><p> break;[/CODE]</p><p></p><p>u can do an array for the language check too...</p></blockquote><p></p>
[QUOTE="JayCoder, post: 63755, member: 11522"] it's like it's your first time making gsc ... like u came from a c-language, like c++ or c# possibly, I'v not seen people really do case, breaking for menu's since waw and myself tho it's not a really officiant way.... and i think ur using iprintln for the text structure which is weird ... just use setText... unless u can't for cod mw, it certain cases case breaking is good, but ur making a menu not a toggle or a function... so it's just gunna cause more code, script. u could use this example: function look up information: [CODE=cpp]void <hud_element> SetText(<text>) [MANDATORY] <text> A localized text reference CATEGORY: UI CLIENT/SERVER: Server SUMMARY: Set HUD text for this element. EXAMPLE: level.introstring1 SetText(string1) testfunction() { self thread mytextExample(0.5,"menu name"); } mytextExample(Time,MenuTitle) { self.mytext = []; self.mytextSet = self hud::CreateFontString("default", "1"); self.mytextSet.alpha = 1; text_spacing_x = 10; for(i=0;i<10;i++) { //varibles self.mytextSet["example_sub"+i].hideWhenInMenu = true; self.mytextSet["example_title"].hideWhenInMenu = true; self.mytextSet["example_title"].sort = 0; self.mytextSet["example_sub"+i].sort = i; self.mytextSet["example_sub"+i] hud::setPoint("CENTER", "CENTER", 0, text_spacing_x * i); self.mytextSet["example_title"] hud::setPoint("CENTER", "CENTER", 0, 0); //Structure self.mytextSet["example_title"] SetText(MenuTitle); self.mytextSet["example_sub"+i] SetText("Sub Option: " + i); //Color textElem.color = (1,1,1); wait time; } wait time; return self.mytextSet; } //menu would look something like this possibly /* menu name sub option: 1 sub option: 2 sub option: 3 sub option: 4 sub option: 5 sub option: 6 sub option: 7 sub option: 8 sub option: 9 sub option: 10 */ [/CODE] I don't know if that example works, but it should, if I we're creating text on cod mw that is something i would do possibly.. this is a super simple example for creating text as u can see, I take the variable I and it 10 times using a for loop and also make a title without the I so it doesn't make multiple titles, then use it for the subtext to make a structure, by putting it into an array. it just looks like c++ code, [CODE=cpp] case "ModMenuOpenDescription": if ( selfLang == level.MODDEF.LN_EN ) { return "^3Give random weapon to press^1 [{+speed_throw}] + [{+melee}] ^3."; } else if ( selfLang == level.MODDEF.LN_JA ) { return "^3ランダム武器は^1 [{+speed_throw}] + [{+melee}] ^3で取得できます。"; } else if ( selfLang == level.MODDEF.LN_CN ) { return "^3随机武器^1 [{+speed_throw}] + [{+melee}] ^3你可以得到。"; } else if ( selfLang == level.MODDEF.LN_RU ) { return "^3случайное оружие ^1 [{+speed_throw}] + [{+melee}] ^3вы можете получить."; } break;[/CODE] u can do an array for the language check too... [/QUOTE]
Verification
Post reply
Forums
Gaming
Call of Duty Classics
Call of Duty: Warzone
[CoD:MW (2019)] GSC Managed code list
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