• Custom Q Menu
    6 replies, posted
I am currently working on a custom QMenu, I have run into a few issues. include( 'controlpanel.lua' ) local PANEL = {} AccessorFunc( PANEL, "m_TabID", "TabID" ) ----------------------------------------------------------- Name: Paint ----------------------------------------------------------- function PANEL:Init() self.List = vgui.Create( "DCategoryList", self ) self.List:Dock( LEFT ) self.List:SetWidth( 130 ) self.Content = vgui.Create( "DCategoryList", self ) self.Content:Dock( FILL ) self.Content:DockMargin( 6, 0, 0, 0 ) self:SetWide( 390 ) if ( ScrW() > 1280 ) then self:SetWide( 460 ) end end Lua Error: [ERROR] addons/alib/lua/alib/client/cl_qmenu.lua:10: function arguments expected near 'function'   1. unknown - addons/alib/lua/alib/client/cl_qmenu.lua:0 This is the only error that I receive, what is wrong with the function? PANEL:Init() doesn't take any arguments...
----------------------------------------------------------- Name: Paint ----------------------------------------------------------- The 'Name' part needs to be commented as well. ----------------------------------------------------------- -- Name: Paint -----------------------------------------------------------
You sir, are a god. I cannot believe that I missed that x.x Lol
Did you add AddCSLuaFile?
AddCSLuaFile( 'controlpanel.lua') include( 'controlpanel.lua' ) local PANEL = {} AccessorFunc( PANEL, "m_TabID", "TabID" ) ----------------------------------------------------------- -- Name: Paint ----------------------------------------------------------- function PANEL:Init() self.List = vgui.Create( "DCategoryList", self ) self.List:Dock( LEFT ) self.List:SetWidth( 130 ) self.Content = vgui.Create( "DCategoryList", self ) self.Content:Dock( FILL ) self.Content:DockMargin( 6, 0, 0, 0 ) self:SetWide( 390 ) if ( ScrW() > 1280 ) then self:SetWide( 460 ) end end Lua Error: Couldn't include file 'controlpanel.lua' (File not found) (@addons/alib/lua/alib/client/cl_qmenu.lua (line 2)) Lua Error: [ERROR] gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/custom.lua:191: attempt to call field 'GetCustomPropTable' (a nil value)   1. fn - gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/custom.lua:191    2. Call - addons/ulib/lua/ulib/shared/hook.lua:109     3. CallPopulateHook - gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/content.lua:49      4. Function - gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/content.lua:80       5. unknown - gamemodes/sandbox/gamemode/spawnmenu/creationmenu.lua:38
From what I can see, you're calling AddCSLuaFile from a clientside file, it has to be called in a server file otherwise it won't do anything. That second error is quite strange since it's a function from a degault module, maybe some script is messing with it.
It won't make errors when called client side, it's a shared function because it just doesn't do anything on client. See wiki page. :P
Sorry, you need to Log In to post a reply to this thread.