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: Modern Warfare
Call of Duty: Modern Warfare Scripts
Creating Shaders
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="V1RU5" data-source="post: 41304" data-attributes="member: 125618"><p style="text-align: center"><strong><span style="font-size: 18px">[SOLVED]</span></strong></p><p>Thank you <a href="https://cabconmodding.com/members/p-x.24/" target="_blank"><span style="color: #0080ff">@<u>P!X</u></span></a> and <a href="https://cabconmodding.com/members/isocheated.70367/" target="_blank"><span style="color: #0080ff">@<u>ISOCheated</u></span></a></p><p>It was just because Developer was set to 1.</p><p></p><p>I know this game is dead but I want to make a single player menu just because.</p><p>Im using this as 'createRectangle'</p><p>[CODE]createRectangle(align, relative, x, y, width, height, color, alpha, sorting, shadero)</p><p>{</p><p> barElemBG = newHudElem(self);</p><p> barElemBG.elemType = "bar";</p><p> barElemBG.width = width;</p><p> barElemBG.height = height;</p><p> barElemBG.align = align;</p><p> barElemBG.relative = relative;</p><p> barElemBG.xOffset = 0;</p><p> barElemBG.yOffset = 0;</p><p> barElemBG.children = [];</p><p> barElemBG.color = color;</p><p> barElemBG.alpha = alpha;</p><p> barElemBG setShader( shadero, width , height );</p><p> barElemBG.hidden = false;</p><p> barElemBG.sort = sorting;</p><p> barElemBG setPoint(align,relative,x,y);</p><p> return barElemBG;</p><p>}[/CODE]</p><p></p><p>Here is the shader I'm trying to use (its pre-cached)</p><p>[CODE]_createhud()</p><p>{</p><p> self.Hud["BG"] = createRectangle("TOP", "TOP", 190, 0, 200, 200, (0,0,0), (1/4), 0, "white");</p><p>}</p><p>_destroyhud()</p><p>{</p><p> self.Hud["BG"] destroy();</p><p>}[/CODE]</p><p></p><p>So the problem is every time I open the menu it shows the shader but I get this error and I don't know how to fix it.</p><p>[CODE]</p><p>******* Script runtime error *******</p><p>cannot cast undefined to int: (file ' maps/_hud_util.gsc', line 183)</p><p>self.bar.x = self.x - int((self.wudth - self.padding) / 2);</p><p> *</p><p>Error: called from:</p><p>(file 'maps/_hud_util.gsc', line 161)</p><p>setPointBar( point, relativePoint, xOffset, yOffset);</p><p> *</p><p>Error: called from:</p><p>(file 'maps/_main.gsc', line 130)</p><p>barElemBG setPoint(align,relative,x,y);</p><p> *</p><p>Error: called from:</p><p>(file 'maps/_main.gsc', line 85)</p><p>self.Hud["BG"] = createRectangle("TOP", "TOP", 190, 0, 200, 200, (0,0,0), (1/4), 0, "white");</p><p> *</p><p>Error: called from:</p><p>(file 'maps/_main.gsc', line 43)</p><p>self _createHud();</p><p> *</p><p>Error: called from:</p><p>(file 'maps/_main.gsc', line 58)</p><p>wait 0.1;</p><p> *</p><p>[/CODE]</p><p>Please help, thank you in advance!</p><p style="text-align: center"><s>—————————<s>——</s>————</s>Video<s>——————————<s>——</s>———-</s></p> <p style="text-align: center">[MEDIA=youtube]NGxxvS9it_g[/MEDIA]</p></blockquote><p></p>
[QUOTE="V1RU5, post: 41304, member: 125618"] [CENTER][B][SIZE=5][SOLVED][/SIZE][/B][/CENTER] Thank you [URL='https://cabconmodding.com/members/p-x.24/'][COLOR=#0080ff]@[U]P!X[/U][/COLOR][/URL] and [URL='https://cabconmodding.com/members/isocheated.70367/'][COLOR=#0080ff]@[U]ISOCheated[/U][/COLOR][/URL] It was just because Developer was set to 1. I know this game is dead but I want to make a single player menu just because. Im using this as 'createRectangle' [CODE]createRectangle(align, relative, x, y, width, height, color, alpha, sorting, shadero) { barElemBG = newHudElem(self); barElemBG.elemType = "bar"; barElemBG.width = width; barElemBG.height = height; barElemBG.align = align; barElemBG.relative = relative; barElemBG.xOffset = 0; barElemBG.yOffset = 0; barElemBG.children = []; barElemBG.color = color; barElemBG.alpha = alpha; barElemBG setShader( shadero, width , height ); barElemBG.hidden = false; barElemBG.sort = sorting; barElemBG setPoint(align,relative,x,y); return barElemBG; }[/CODE] Here is the shader I'm trying to use (its pre-cached) [CODE]_createhud() { self.Hud["BG"] = createRectangle("TOP", "TOP", 190, 0, 200, 200, (0,0,0), (1/4), 0, "white"); } _destroyhud() { self.Hud["BG"] destroy(); }[/CODE] So the problem is every time I open the menu it shows the shader but I get this error and I don't know how to fix it. [CODE] ******* Script runtime error ******* cannot cast undefined to int: (file ' maps/_hud_util.gsc', line 183) self.bar.x = self.x - int((self.wudth - self.padding) / 2); * Error: called from: (file 'maps/_hud_util.gsc', line 161) setPointBar( point, relativePoint, xOffset, yOffset); * Error: called from: (file 'maps/_main.gsc', line 130) barElemBG setPoint(align,relative,x,y); * Error: called from: (file 'maps/_main.gsc', line 85) self.Hud["BG"] = createRectangle("TOP", "TOP", 190, 0, 200, 200, (0,0,0), (1/4), 0, "white"); * Error: called from: (file 'maps/_main.gsc', line 43) self _createHud(); * Error: called from: (file 'maps/_main.gsc', line 58) wait 0.1; * [/CODE] Please help, thank you in advance! [CENTER][S]—————————[S]——[/S]————[/S]Video[S]——————————[S]——[/S]———-[/S] [MEDIA=youtube]NGxxvS9it_g[/MEDIA][/CENTER] [/QUOTE]
Verification
Post reply
Forums
Gaming
Call of Duty Classics
Call of Duty: Modern Warfare
Call of Duty: Modern Warfare Scripts
Creating Shaders
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