Motd Lua error

So I recently added QAC anti-cheat and when I restarted my server everything was ok but when I joined it this. ps: dont know how to use past bins…

Client “M21z” connected (...:*).
Writing cfg/banned_user.cfg.
TTT initializing convar settings…
[M21z|2|STEAM_0:0:34705666] Lua Error:

[ERROR] addons/ulx/lua/ulx/modules/cl/motdmenu.lua:29: bad argument #1 to ‘SetHTML’ (string expected, got no value)

  1. SetHTML - [C]:-1
  2. fn - addons/ulx/lua/ulx/modules/cl/motdmenu.lua:29
  3. func - addons/ulib/lua/ulib/client/cl_util.lua:22
  4. unknown - lua/includes/modules/net.lua:32

This is a copy of that motdmenu script
(it should be pretty basic, havnt

ulx.motdmenu_exists = true

local isUrl
local url

function ulx.showMotdMenu( steamid )
local window = vgui.Create( “DFrame” )
if ScrW() > 640 then – Make it larger if we can.
window:SetSize( ScrW()*0.9, ScrH()*0.9 )
else
window:SetSize( 640, 480 )
end
window:Center()
window:SetTitle( “ULX MOTD” )
window:SetVisible( true )
window:MakePopup()

local html = vgui.Create( "HTML", window )

local button = vgui.Create( "DButton", window )
button:SetText( "Close" )
button.DoClick = function() window:Close() end
button:SetSize( 100, 40 )
button:SetPos( (window:GetWide() - button:GetWide()) / 2, window:GetTall() - button:GetTall() - 10 )

html:SetSize( window:GetWide() - 20, window:GetTall() - button:GetTall() - 50 )
html:SetPos( 10, 30 )
if not isUrl then
	html:SetHTML( ULib.fileRead( "data/ulx_motd.txt" ) )
else
	url = string.gsub( url, "%%curmap%%", game.GetMap() )
	url = string.gsub( url, "%%steamid%%", steamid )
	html:OpenURL( url )
end

end

function ulx.rcvMotd( isUrl_, text )
isUrl = isUrl_
if not isUrl then
ULib.fileWrite( “data/ulx_motd.txt”, text )
else
if text:find( “://”, 1, true ) then
url = text
else
url = “http://” … text
end
end
end

Thanks in advance please help me if you know how…

You called SetHTML with no information or a nil variable… Here’s an example MOTD: https://dl.dropboxusercontent.com/u/26074909/tutoring/vgui/motd.lua.html

reinstall ulx and try to use [lua] tags next time :slight_smile:

I really dont understand how to fix this, can you explain to me in detail where to put that code and what really is the problem… :pwn:

Make it look like this, with chat tags
[lua]
lient “M21z” connected (...:*).
Writing cfg/banned_user.cfg.
TTT initializing convar settings…
[M21z|2|STEAM_0:0:34705666] Lua Error:

[ERROR] addons/ulx/lua/ulx/modules/cl/motdmenu.lua:29: bad argument #1 to ‘SetHTML’ (string expected, got no value)

  1. SetHTML - [C]:-1
  2. fn - addons/ulx/lua/ulx/modules/cl/motdmenu.lua:29
  3. func - addons/ulib/lua/ulib/client/cl_util.lua:22
  4. unknown - lua/includes/modules/net.lua:32

This is a copy of that motdmenu script
(it should be pretty basic, havnt

ulx.motdmenu_exists = true

local isUrl
local url

function ulx.showMotdMenu( steamid )
local window = vgui.Create( “DFrame” )
if ScrW() > 640 then – Make it larger if we can.
window:SetSize( ScrW()*0.9, ScrH()*0.9 )
else
window:SetSize( 640, 480 )
end
window:Center()
window:SetTitle( “ULX MOTD” )
window:SetVisible( true )
window:MakePopup()

local html = vgui.Create( “HTML”, window )

local button = vgui.Create( “DButton”, window )
button:SetText( “Close” )
button.DoClick = function() window:Close() end
button:SetSize( 100, 40 )
button:SetPos( (window:GetWide() - button:GetWide()) / 2, window:GetTall() - button:GetTall() - 10 )

html:SetSize( window:GetWide() - 20, window:GetTall() - button:GetTall() - 50 )
html:SetPos( 10, 30 )
if not isUrl then
html:SetHTML( ULib.fileRead( “data/ulx_motd.txt” ) )
else
url = string.gsub( url, “%%curmap%%”, game.GetMap() )
url = string.gsub( url, “%%steamid%%”, steamid )
html:OpenURL( url )
end
end

function ulx.rcvMotd( isUrl_, text )
isUrl = isUrl_
if not isUrl then
ULib.fileWrite( “data/ulx_motd.txt”, text )
else
if text:find( “://”, 1, true ) then
url = text
else
url = “http://” … text
end
end
end
[/lua]

I cant fix this… anymore help? ever since I got QAC anticheat it started this

Methods:

  1. Dont use ulx
  2. Dont use QAC (and be safe)
  3. Make your own MOTD
  4. Check if data/ulx_motd.txt is empty
  5. Disable MOTD
  6. sweg

So I got rid of QAC and everything was working correctly… Should I post something on QAC thread about this problem?

Zero doesn’t care anymore; unless you can track down the issue to a specific function, then nothing can be done.

ah well if he cant care anymore people will stop using his AC even tho its free and everything… Im gonna go use LeyAC now even tho it $150. Time to make some calls lol

CONTACT the author of the addon.

I’ve looked into this and have been referred to this problem by about 4 different people.

[lua]
url = string.gsub( url, “%%curmap%%”, game.GetMap() )[/lua]

This is the issue, specifically [lua]string.gsub()[/lua] returns nil regardless of input, for some reson.

I cannot figure out the issue as qac has never even touched the string library, edited, or even detoured it for that matter, so until someone ELSE figures out why it happens, I cannot exactly fix it or tell you why this happens.

[editline]29th September 2014[/editline]

As long as it isnt a “pls remake qac” or “fix this ambiguous error” I’ll fix it

[editline]29th September 2014[/editline]

Example of how not to report

I know that your trying to help but its QAC’s fault, I got rid of it and motd started working properly. Something in QAC was causing the motd not to display so thats why I dont use it anymore…

I’d suggested properly lining your end’s with the function’s.