• One Assmod Error
    9 replies, posted
I am getting this error with assmod: [ass_client.lua:604] attempt to get length of field 'Panels' (a nil value) Here is the code for that file: [code] include("ass_shared.lua") ASS_Initialized = false local PLAYER = FindMetaTable("Player") function PLAYER:UniqueID() return self:GetNetworkedString("ASS_UniqueID") end PLAYER = nil function ASS_KickPlayer( INFO ) if (!ValidEntity(INFO.Player)) then return true end if (#INFO.Reason > 0) then RunConsoleCommand("ASS_KickPlayer", INFO.Player:UniqueID(), INFO.Reason) else RunConsoleCommand("ASS_KickPlayer", INFO.Player:UniqueID() ) end return true end function ASS_SetAccess( PLAYER, LEVEL, TIME ) if (!ValidEntity(PLAYER)) then return true end RunConsoleCommand("ASS_PromotePlayer", PLAYER:UniqueID(), LEVEL) end function ASS_CustomReason(INFO) Derma_StringRequest( "Custom Reason...", "Why do you want to " .. INFO.Type .. " " .. INFO.Player:Nick() .. "?", "", function( strTextOut ) table.insert(ASS_Config["reasons"], { name = strTextOut, reason = strTextOut } ) ASS_WriteConfig() INFO.Reason = strTextOut INFO.Function(INFO) end ) end function ASS_KickReasonMenu( MENUITEM, PLAYER, INFO ) INFO = {} INFO.Function = ASS_KickPlayer INFO.Type = "kick" INFO.Player = PLAYER for k, v in pairs(ASS_Config["reasons"]) do MENUITEM:AddOption( (v.name or ("Unnamed #" .. k)), function() INFO.Reason = v.reason or "" return INFO.Function(INFO) end ) end MENUITEM:AddSpacer() MENUITEM:AddOption( "Custom...", function() ASS_CustomReason(INFO) end ) end function ASS_TempAdminMenu( MENU, PLAYER ) for k, v in pairs(ASS_Config["temp_admin_times"]) do MENU:AddOption(v.name, function() ASS_SetAccess(PLAYER, ASS_LVL_TEMPADMIN, v.time) end ) end end function ASS_AccessMenu( SUBMENU, PLAYER ) local Items = {} Items[ASS_LVL_SUPER_ADMIN] = SUBMENU:AddOption( "Super Admin", function() ASS_SetAccess(PLAYER, ASS_LVL_SUPER_ADMIN) end ) Items[ASS_LVL_ADMIN] = SUBMENU:AddOption( "Admin", function() ASS_SetAccess(PLAYER, ASS_LVL_ADMIN) end ) Items[ASS_LVL_TEMPADMIN] = SUBMENU:AddSubMenu( "Temp Admin" , nil, function(NEWMENU) ASS_TempAdminMenu( NEWMENU, PLAYER ) end ) Items[ASS_LVL_GUEST] = SUBMENU:AddOption( "Guest", function() ASS_SetAccess(PLAYER, ASS_LVL_GUEST) end ) if (Items[ PLAYER:GetLevel() ]) then Items[ PLAYER:GetLevel() ]:SetImage("gui/silkicons/check_on_s") end end function ASS_TableContains( TAB, VAR ) if (!TAB) then return false end for k,v in pairs(TAB) do if (v == VAR) then return true end end return false end // Oh god this is going to be hacky // Fixed by SammyServers.com function ASS_FixMenu( MENU ) // Call the callback when we need to build the menu // If we're creating the menu now, also register our // hacked functions with it, so this hack propagates // virus like among any DMenus spawned from this // parent DMenu.. muhaha function DMenuOption_OnCursorEntered(self) local m = self.SubMenu if (self.BuildFunction) then m = DermaMenu( self ) ASS_FixMenu(m) m:SetVisible( false ) m:SetParent( self:GetParent() ) PCallError( self.BuildFunction, m) end self.ParentMenu:OpenSubMenu( self, m ) end // Menu item images! function DMenuOption_SetImage(self, img) self.Image = ASS_Icon(img) end // Change the released hook so that if the click function // returns a non-nil or non-false value then the menus // get closed (this way menus can stay opened and be clicked // several time). function DMenuOption_OnMouseReleased( self, mousecode ) DButton.OnMouseReleased( self, mousecode ) if ( self.m_MenuClicking ) then self.m_MenuClicking = false if (!self.ClickReturn) then CloseDermaMenus() end end end // Make sure we draw the image, should be done in the skin // but this is a total hack, so meh. function DMenuOption_Paint(self) derma.SkinHook( "Paint", "MenuOption", self ) if (self.Image) then surface.SetTexture( self.Image ) surface.SetDrawColor( 255, 255, 255, 255 ) surface.DrawTexturedRect( 2, (self:GetTall() - 16) * 0.5, 16, 16) end return false end // Make DMenuOptions implement our new functions above. // Returns the new DMenuOption created. local function DMenu_AddOption( self, strText, funcFunction ) local pnl = vgui.Create( "DMenuOption", self ) pnl.OnCursorEntered = DMenuOption_OnCursorEntered pnl.OnMouseReleased = DMenuOption_OnMouseReleased pnl.Paint = DMenuOption_Paint pnl.SetImage = DMenuOption_SetImage pnl:SetText( strText ) if ( funcFunction ) then pnl.DoClick = function(self) self.ClickReturn = funcFunction(pnl) end end self:AddPanel( pnl ) return pnl end // Make DMenuOptions implement our new functions above. // If we're creating the menu now, also register our // hacked functions with it, so this hack propagates // virus like among any DMenus spawned from this // parent DMenu.. muhaha // Returns the new DMenu (if it exists), and the DMenuOption // created. local function DMenu_AddSubMenu( self, strText, funcFunction, openFunction ) local SubMenu = nil if (!openFunction) then SubMenu = DermaMenu( self ) ASS_FixMenu(SubMenu) SubMenu:SetVisible( false ) SubMenu:SetParent( self ) end local pnl = vgui.Create( "DMenuOption", self ) pnl.OnCursorEntered = DMenuOption_OnCursorEntered pnl.OnMouseReleased = DMenuOption_OnMouseReleased pnl.Paint = DMenuOption_Paint pnl.SetImage = DMenuOption_SetImage pnl.BuildFunction = openFunction pnl:SetSubMenu( SubMenu ) pnl:SetText( strText ) if ( funcFunction ) then pnl.DoClick = function() pnl.ClickReturn = funcFunction(pnl) end else pnl.DoClick = function() pnl.ClickReturn = true end end self:AddPanel( pnl ) if (SubMenu) then return SubMenu, pnl else return pnl end end // Register our new hacked function. muhahah MENU.AddOption = DMenu_AddOption MENU.AddSubMenu = DMenu_AddSubMenu end // See, told you it was hacky, hopefully won't have to do this for much longer // This function was once fairly neat and tidy... Now it's a big // mess of anonymous functions and submenus. // I'd tidy it up, but I think it'd stop working, or break everything... // It's only the "IncludeAll" options that really screw it up actually, // but it adds soo much flexability it's totally worth it. function ASS_PlayerMenu( SUBMENU, OPTIONS, FUNCTION, ... ) if (type(SUBMENU) != "Panel") then Msg("ASS_PlayerMenu: SUBMENU isn't a menu!\n") return end local others = player.GetAll() local includeSubMenus = ASS_TableContains(OPTIONS, "HasSubMenu") local includeSelf = ASS_TableContains(OPTIONS, "IncludeLocalPlayer") local includeAll = ASS_TableContains(OPTIONS, "IncludeAll") local includeAllSO = ASS_TableContains(OPTIONS, "Includ
At line 603 and 604 there is this only: end )
[QUOTE=!!!WARLOCK!!!;36549233]At line 603 and 604 there is this only: end )[/QUOTE] What does that mean?
Any help with this?
ASSMod has been broken since the beginning of time. There's some updated version that work, albeit a bit buggy.
[QUOTE=Lolcats;36572074]ASSMod has been broken since the beginning of time. There's some updated version that work, albeit a bit buggy.[/QUOTE] This worked up until the patch that Garry put out a few days ago.
And that can't possibly be the right file. There is no word "Panels" ANYWHERE in the entire code. Are you giving us the entire code from ass_client.lua?
try to use ulx admin mod , but ulx tables broken for mine.
I've always found ULX to be boring and drab. I always liked something like [url=http://www.facepunch.com/showthread.php?t=937056]Exsto[/url] because of how easy it is to create your own Modules. Granted it's a little buggy, but nothing anyone with simple lua experience shouldn't be able to fix.
[QUOTE=Lolcats;36579901]I've always found ULX to be boring and drab. I always liked something like [url=http://www.facepunch.com/showthread.php?t=937056]Exsto[/url] because of how easy it is to create your own Modules. Granted it's a little buggy, but nothing anyone with simple lua experience shouldn't be able to fix.[/QUOTE] Not very helpful for my current situation lol. I still havent found a fix.
Sorry, you need to Log In to post a reply to this thread.