Error:
[code]
[ERROR] addons/ulx/lua/ulx/modules/cl/motdmenu.lua:254: bad argument #1 to 'SetHTML' (string expected, got no value)
1. SetHTML - [C]:-1
2. fn - addons/ulx/lua/ulx/modules/cl/motdmenu.lua:254
3. func - addons/ulib/lua/ulib/client/cl_util.lua:22
4. unknown - lua/includes/modules/net.lua:30
[/code]
Script:
[code]
ulx.motdmenu_exists = true
-- DON'T EDIT THAT
local isUrl
local url
-- MOTD BUTTON SETUP
local MainURL = "http://www.use.com/images/s_5/sorted/Future_60a73cc9ee681758f39e.jpg" --Main Motd URL Website, I REALLY recommend to run the motd by url.
local MotdText = "Welcome to Future-Gaming Deathrun!" --Motd Main Windows Tittle.
local AcceptButtonText = "I'm Awesome!" --Text for Accept rules button
local AcceptButtonTime = 10 --accept rules button will appear only after "X" seconds.
local AcceptSay = "I agree to join Future-Gaming!" --Say in chat "X" message when I click on accept rules button.
local DeclineButton = true --Spawn Decline Button ?
local DeclineButtonText = "I'm noob, kick me!" --Text for Decline rules button
local DeclineSay = "I disagree to Join Future-Gaming!" --Say in chat "X" message when I clic on decline rules button.
local DeclineKickTime = 5 --time to kick the player if he decline rules, don't put so low, the script need to run "DeclineSay" before.
local WebButtonText = "Open Web Menu" --Text to open the Web Menu
local CloseWebButtonText = "Close Web Menu" --Text to close the Web Menu
local ReturnButtonText = "Main page" --Text for Return on Main URL Page button.
local CloseMotdButtonText = "Close Motd Page" --Text for Close Motd Page button.
--Website Setup
local Website1ButtonText = "Google" --Text for 1st Website button.
local Website2ButtonText = "Rules" --Text for 3nd Website button.
local Website3ButtonText = "FacePunch" --Text for 4nd Website button.
local Website4ButtonText = "Workshop"
local Website1URL = "http://www.google.com/" --1st Webstie URL
local Website2URL = "http://futuregamingdeathrun.enjin.com/forum/viewthread/12678122/page/1/m/22773691" --3nd Website URL
local Website3URL = "http://www.facepunch.com/" --4nd Website URL
local Website4URL = "http://steamcommunity.com/workshop/browse?appid=4000"
--------------------------------------------------------------------------------------
-------DON'T EDIT ANYTHING BELLOW, if you know what you do, it's your choice !--------
--------------------------------------------------------------------------------------
function ulx.showMotdMenu()
--creating main windows
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( MotdText )
window:SetVisible( true )
window:MakePopup()
--creating windows for html
local html = vgui.Create( "HTML", window )
--AcceptButton
local AcceptButton = vgui.Create( "DButton", window )
if AcceptButtonText == "" then
AcceptButton:SetText( "Close" )
else
AcceptButton:SetText( AcceptButtonText )
end
AcceptButton.DoClick = function()
if AcceptSay != "" then
RunConsoleCommand("say", AcceptSay)
end
window:Close()
gui.EnableScreenClicker(false) -- Disable the mouse
end
AcceptButton:SetSize( 90, 40 )
if AcceptButtonTime > 0 then
AcceptButton:SetDisabled( true )
timer.Simple( AcceptButtonTime, function()
AcceptButton:SetDisabled( false )
end )
end
if !DeclineButton then
AcceptButton:SetPos( (window:GetWide() - AcceptButton:GetWide()) / 2.5, window:GetTall() - AcceptButton:GetTall() - 10 )
else
AcceptButton:SetPos( ( window:GetWide() / 4.0 ) - ( AcceptButton:GetWide() / 2 ), window:GetTall() - 57 )
--DeclineButton
local DeclineButton = vgui.Create( "DButton", window )
DeclineButton:SetSize( 110, 40 )
DeclineButton:SetPos( ( window:GetWide() / 3.0 ) - ( DeclineButton:GetWide() / 2 ), window:GetTall() - 57 )
if DeclineButtonText == "" then
DeclineButton:SetText( "Decline" )
else
DeclineButton:SetText( DeclineButtonText )
end
DeclineButton:SetVisible( true )
DeclineButton.DoClick = function()
if DeclineSay != "" then
RunConsoleCommand("say", DeclineSay)
window:Close()
end
if DeclineKickTime > 0 then
timer.Simple( DeclineKickTime, function()
RunConsoleCommand( "disconnect" )
end )
end
end
end
--CloseMotd page Button
local CloseMotdButton = vgui.Create( "DButton", window )
CloseMotdButton:SetSize( 110, 40 )
CloseMotdButton:SetPos( ( window:GetWide() / 1.1 ) - ( CloseMotdButton:GetWide() / 2 ), window:GetTall() - 57 )
if CloseMotdButtonText == "" then
CloseMotdButton:SetText( "Return" )
else
CloseMotdButton:SetText( CloseMotdButtonText )
end
CloseMotdButton:SetVisible( true )
CloseMotdButton:SetDisabled( true )
CloseMotdButton.DoClick = function()
window:Close()
end
--Return on main page Button
local ReturnButton = vgui.Create( "DButton", window )
ReturnButton:SetSize( 100, 40 )
ReturnButton:SetPos( ( window:GetWide() / 1.6 ) - ( ReturnButton:GetWide() / 2 ), window:GetTall() - 57 )
if ReturnButtonText == "" then
ReturnButton:SetText( "Return" )
else
ReturnButton:SetText( ReturnButtonText )
end
ReturnButton:SetVisible( false )
ReturnButton.DoClick = function()
html:OpenURL( MainURL )
CloseMotdButton:SetDisabled( false )
end
--Website1 Button
local Website1Button = vgui.Create( "DButton", window )
Website1Button:SetSize( 100, 40 )
Website1Button:SetPos( ( window:GetWide() / 1.4 ) - ( Website1Button:GetWide() / 2 ), window:GetTall() - 45 )
if Website1ButtonText == "" then
Website1Button:SetText( "Website1" )
else
Website1Button:SetText( Website1ButtonText )
end
Website1Button:SetVisible( false )
Website1Button.DoClick = function()
html:OpenURL( Website1URL )
CloseMotdButton:SetDisabled( false )
end
--Website2 Button
local Website2Button = vgui.Create( "DButton", window )
Website2Button:SetSize( 100, 40 )
Website2Button:SetPos( ( window:GetWide() / 1.4 ) - ( Website2Button:GetWide() / 2 ), window:GetTall() - 90 )
if Website2ButtonText == "" then
Website2Button:SetText( "Website2" )
else
Website2Button:SetText( Website2ButtonText )
end
Website2Button:SetVisible( false )
Website2Button.DoClick = function()
html:OpenURL( Website2URL )
CloseMotdButton:SetDisabled( false )
end
--Website3 Button
local Website3Button = vgui.Create( "DButton", window )
Website3Button:SetSize( 100, 40 )
Website3Button:SetPos( ( window:GetWide() / 1.25 ) - ( Website3Button:GetWide() / 2 ), window:GetTall() - 45 )
if Website3ButtonText == "" then
Website3Button:SetText( "Website3" )
else
Website3Button:SetText( Website3ButtonText )
end
Website3Button:SetVisible( false )
Website3Button.DoClick = function()
html:OpenURL( Website3URL )
CloseMotdButton:SetDisabled( false )
end
--Website4 Button
local Website4Button = vgui.Create( "DButton", window )
Website4Button:SetSize( 100, 40 )
Website4Button:SetPos( ( window:GetWide() / 1.25 ) - ( Website4Button:GetWide() / 2 ), window:GetTall() - 90 )
if Website4ButtonText == "" then
Website4Button:SetText( "Website4" )
else
Website4Button:SetText( Website4ButtonText )
end
Website4Button:SetVisible( false )
Website4Button.DoClick = function()
html:OpenURL( Website4URL )
CloseMotdButton:SetDisabled( false )
end
--Open WebButton
local CloseWebButton = vgui.Create( "DButton", window )
local WebButton = vgui.Create( "DButton", window )
WebButton:SetSize( 100, 40 )
WebButton:SetPos( ( window:GetWide() / 1.25 ) - ( We
file.Read( "ulx/motd.txt" ) returns nil
[editline]6th May 2014[/editline]
Probably means file doesn't exist.
[QUOTE=Robotboy655;44738687]file.Read( "ulx/motd.txt" ) returns nil
[editline]6th May 2014[/editline]
Probably means file doesn't exist.[/QUOTE]
So I can just change motd to the file of this file name?
[QUOTE=MistyPanda;44738708]So I can just change motd to the file of this file name?[/QUOTE]
What?
[QUOTE=Robotboy655;44738716]What?[/QUOTE]
So what would I need to do?
[QUOTE=MistyPanda;44738731]So what would I need to do?[/QUOTE]
Rename your motd file to motd.txt and put it in the ULX folder I think.
Do you have a file called ulx motd in addon/ulx ? If not create a txt file called ulx_motd in addon/ulx. After you've done that paste this code in it. [CODE]<html>
<body bgcolor=#dbdbdb>
<div style="text-align: center;">
<div style="width: 80%; margin: 0px auto; border: 10px solid #c9d6e4; background-color: #ededed; padding: 10px; font-size: 12px; font-family: Tahoma; margin-top: 30px; color: #818181; text-align: left;">
<div style="font-size: 30px; font-family: impact; width: 100%; margin-bottom: 5px;">My Server Name</div>
<br>
This Server uses the following mods:<br>
ULX, PropDefender, and VMFLoader.<br>
<br>
<h2>Rules</h2>
1. DON'T MESS WITH OTHER PLAYERS STUFF. If they want help, they'll ask!<br>
2. Don't spam.<br>
3. Have fun.<br>
<div style="width: 100%; text-align: center; margin: 10px; font-weight: bold;">- The Admins</div>
</div>
</div>
</body>
</html>[/CODE]
[QUOTE=Icejjfish;44738762]Do you have a file called ulx motd in addon/ulx ? If not create a txt file called ulx_motd in addon/ulx. After you've done that paste this code in it. [CODE]<html>
<body bgcolor=#dbdbdb>
<div style="text-align: center;">
<div style="width: 80%; margin: 0px auto; border: 10px solid #c9d6e4; background-color: #ededed; padding: 10px; font-size: 12px; font-family: Tahoma; margin-top: 30px; color: #818181; text-align: left;">
<div style="font-size: 30px; font-family: impact; width: 100%; margin-bottom: 5px;">My Server Name</div>
<br>
This Server uses the following mods:<br>
ULX, PropDefender, and VMFLoader.<br>
<br>
<h2>Rules</h2>
1. DON'T MESS WITH OTHER PLAYERS STUFF. If they want help, they'll ask!<br>
2. Don't spam.<br>
3. Have fun.<br>
<div style="width: 100%; text-align: center; margin: 10px; font-weight: bold;">- The Admins</div>
</div>
</div>
</body>
</html>[/CODE][/QUOTE]
Still says
[ERROR] addons/ulx/lua/ulx/modules/cl/motdmenu.lua:254: bad argument #1 to 'SetHTML' (string expected, got no value)
1. SetHTML - [C]:-1
2. fn - addons/ulx/lua/ulx/modules/cl/motdmenu.lua:254
3. func - addons/ulib/lua/ulib/client/cl_util.lua:22
4. unknown - lua/includes/modules/net.lua:30
Any other suggestions?
Or
Any other MOTD like this?
What is the txt file you created name?
Make the file "motd.txt" within the ulx folder. Alternatively, just re-install ULX and it'll fix everything. Groups will remain etc.
Here's how I do it; granted the current version of mine does more, here's a stripped version with some basic features: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/vgui/motd.lua.html[/url]
Sorry, you need to Log In to post a reply to this thread.