I am not sure of this issue could someone help?
[code] [ass_client.lua:203] attempt to call method 'OpenSubMenu' (a nil value)
[ass_client.lua:203] attempt to call method 'OpenSubMenu' (a nil value)
[ass_client.lua:469] attempt to get length of field 'Panels' (a nil value)[ass_client.lua:203] attempt to call method 'OpenSubMenu' (a nil value)
[ass_client.lua:487] attempt to get length of field 'Panels' (a nil value)[ass_client.lua:203] attempt to call method 'OpenSubMenu' (a nil value)
[ass_client.lua:469] attempt to get length of field 'Panels' (a nil value)[ass_client.lua:203] attempt to call method 'OpenSubMenu' (a nil value)
[/code]
[code]
These are lines 194-213
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:GetParent():OpenSubMenu( self, m )
end
function DMenuOption_SetImage(self, img)
self.Image = ASS_Icon(img)
end
function DMenuOption_OnMouseReleased( self, mousecode )
[/code]
[code]
These are lines 465 to 473
function ASS_Plugins( SUBMENU )
ASS_RunPluginFunction("AddMenu", nil, SUBMENU )
if (#SUBMENU.Panels == 0) then
SUBMENU:AddOption("(none)", function() end)
end
end
[/code]
[code]
Last but not least lines 475-491
function ASS_Gamemode( SUBMENU )
local function CheckGamemode(PLUGIN)
return PLUGIN.Gamemodes != nil &&
#PLUGIN.Gamemodes > 0 &&
ASS_PluginCheckGamemode(PLUGIN.Gamemodes)
end
ASS_RunPluginFunctionFiltered("AddGamemodeMenu", CheckGamemode, nil, SUBMENU )
if (#SUBMENU.Panels == 0) then
SUBMENU:AddOption("(none)", function() end)
end
end
[/code]
Anyone know the issue?
OpenSubMenu() Is not a valid function.
The weird thing is this worked completely fine before the update, Yesterday it was perfect, Today all the admins attempting to use the PERP ass_menu are being spammed with LUA errors
Gmod update causes panel position issues, none the less most people wont help you with a leaked gamemode for free atleast.
[QUOTE=King Flawless;30037073]Gmod update causes panel position issues, none the less most people wont help you with a leaked gamemode for free atleast.[/QUOTE]
Its not just a PERP issue. Assmod completly shat bricks after the new GMod Update.
[QUOTE=Crap-Head;30045152]Its not just a PERP issue. Assmod completly shat bricks after the new GMod Update.[/QUOTE]
And thats why you dont use an outdated admin mod.
[QUOTE=Science;30045550]And thats why you dont use an outdated admin mod.[/QUOTE]
It was nothing to do with how old the admin mod was a lot things broke with the update
Also, I didnt get the leaked gamemode, I bought it with my own USD so do not be so quick to judge.
CG experiencing same problem, it affects HL2RP as well, well it prity much destroys any menu that uses the submenus.
Same problem.
If anyone has any clue to this issue being resolved (of how to fix submenus) I'll give them cake. Honestly, I've pulled my hair out over this and I have no-dea how to fix it, it just keeps sending me in circles.
[QUOTE=blown25;30036174]OpenSubMenu() Is not a valid function.[/QUOTE]
[url]https://facepunch.svn.beanstalkapp.com/gmodgame/garrysmod/lua/vgui/DMenu.lua[/url]
It's in that
I posted a fix: [url]http://www.facepunch.com/threads/1091924-ASSMod-Officially-broken?p=30085627&viewfull=1#post30085627[/url]
Jimbo, Your fix simply does not work with PERPs assmod
If "Assmod" is being weird. I recommend to change Admin mod e.g Evovl.
Jimbo, ParentPanel doesn't exist in ASSmod..
[QUOTE=nexusowner;30089129]If "Assmod" is being weird. I recommend to change Admin mod e.g Evovl.[/QUOTE]
Lol Evolve, theres no one working on it, go view the thread with so many people having troubles.
Please explain how you fixed assmod. Would be really appreciated.
I fixed it for him, and I already posted exactly how to fix it.
Replace all occurences of panel:GetParent:OpenSubMenu(), one now does panel.ParentPanel:OpenSubMenu(), and instead of #panel.Panels, one now does #panel:GetItems().
I thought CG fixed it?
Here you go, a working version of ass_client.lua. Simple overwrite yours with this:
[lua]
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, "IncludeAllSO")
local NumOptions = 0
if (includeAll || includeAllSO) then
/* I love anonymous functions, good luck understanding what this does! */
if (LocalPlayer():HasLevel(ASS_LVL_SERVER_OWNER) || includeAllSO) then
SUBMENU:AddSubMenu( "All", nil,
function(ALLMENU)
if (includeSubMenus) then
ALLMENU:AddSubMenu( "Players", nil,
function(NEWMENU)
local List = {}
for _, PL in pairs(player.GetAll()) do
if (PL != LocalPlayer() || includeSelf) then
table.insert(List, PL)
end
end
PCallError( FUNCTION, NEWMENU, List, unpack(arg))
end )
ALLMENU:AddSubMenu( "Non-Admins", nil,
function(NEWMENU)
local List = {}
for _, PL in pairs(player.GetAll()) do
if (!PL:IsAdmin() && (PL != LocalPlayer() || includeSelf)) then
table.insert(List, PL)
end
end
PCallError( FUNCTION, NEWMENU, List, unpack(arg))
end )
ALLMENU:AddSubMenu( "Admins", nil,
function(NEWMENU)
local List = {}
for _, PL in pairs(player.GetAll()) do
if (PL:IsAdmin() && (PL != LocalPlayer() || includeSelf)) then
table.insert(List, PL)
end
end
P
Good work Jimbo, way to take one for the team buddy.
Jimbo, YOU ARE GOD! Thank you.
Thank you so much but where's the ban menu and the level "Respected"?
[QUOTE=BananaThief;30187233]Thank you so much but where's the ban menu and the level "Respected"?[/QUOTE]
That ass_client.lua is based off a friend of mine's, who has neither of those two things. Simply grab the functions for Bans, and dump them in the file, and edit around lines 72-84 to add the Respected rank. (Compare this version to your own.)
EDIT: This here is one I did for someone else who showed me their ass_client. May be easier to extract what you need from it: [url]http://pastebin.com/PpuAgKnM[/url] (Bare in mind that one is untested though.)
EDIT3: The one from the link DOES work but it's the same, no ban menu and no level "Respected".
Thanks for your hard work anyway.
Fixed ass_client.lua from the official assmod:
[url]http://pastebin.com/72fRcc8L[/url]
Sorry, you need to Log In to post a reply to this thread.