Issue 77: New feature (forced download or new MOTD system)
Status:  Started
Owner: ----
Reported by epicsand...@gmail.com, May 27, 2010
I want a MOTD for my server. And I love evolve admin mod. ULX has a MOTD
that is always updated on server restart. when a player joins. they
automatically get the new MOTD. I want that. I want it so when a player
joins they are forced to download the new MOTD. and I would like a force
download system. so I can add a directory to force download. like music or
whatever for a mp3 player. Sorry for my bad english. its very late. I have
been up for over 48 hours now.
May 28, 2010
#1 ayr...@gmail.com
If you read the front page you would see that motd is a planned feature howevrer
there is a non official motd plugin on the evolve website.
May 28, 2010
Project Member #2 overv161@gmail.com
Yeah, he's talking about the unofficial MOTD. It only sends you the MOTD once, even
if it's updated. An official plugin will solve that.
Status: Started
May 28, 2010
#3 epicsand...@gmail.com
Thank you so much for your dedication. I am looking much forward to the new updates!
Sep 13, 2010
#4 m.b.rai...@hotmail.com
try using a website as motd,
for example google.sites.com
you can make a webpage there,  and make that as your motd,

when you change the website it automaticly changes in motd as well,  no new download required,

but make sure you got the code like this; 

[code]/*-------------------------------------------------------------------------------------------------------------------------
	Message of the Day
-------------------------------------------------------------------------------------------------------------------------*/

local PLUGIN = {}
PLUGIN.Title = "MOTD"
PLUGIN.Description = "Message of the Day."
PLUGIN.Author = "Divran  /////  edited by Mattheo baaij ( Fortune hunters)"
PLUGIN.ChatCommand = "motd"
PLUGIN.Usage = nil
PLUGIN.Privileges = nil

function PLUGIN:Call( ply, args )
	self:OpenMotd( ply )
end

function PLUGIN:PlayerInitialSpawn( ply )
	timer.Simple( 1, function() ply:ConCommand("evolve_startmotd") end)
end

function PLUGIN:OpenMotd( ply )
	if (SERVER) then
		ply:ConCommand("evolve_motd")
	end
end

if (SERVER) then 
	if (file.Exists("MOTDNAME.txt")) then
		resource.AddFile("data/(MOTDNAME.txt")
	end
end


if (CLIENT) then
	function PLUGIN:CreateMenu()
		self.StartPanel = vgui.Create( "DFrame" )
		local w,h = 150,50
		self.StartPanel:Center()
		self.StartPanel:SetSize( w,h )
		self.StartPanel:SetTitle( "Welcome!" )
		self.StartPanel:SetVisible( false )
		self.StartPanel:SetDraggable( true )
		self.StartPanel:ShowCloseButton( false )
		self.StartPanel:SetDeleteOnClose( false )
		self.StartPanel:SetScreenLock( true )
		self.StartPanel:MakePopup()
		
		self.OpenButton = vgui.Create("DButton",self.StartPanel)
		self.OpenButton:SetSize( 150/2-4, 20 )
		self.OpenButton:SetPos( 2, 25 )
		self.OpenButton:SetText( "Open MOTD" )
		self.OpenButton.DoClick = function() 
			PLUGIN.MotdPanel:SetVisible( true )
			PLUGIN.StartPanel:SetVisible( false ) 
		end
		
		self.CloseButton = vgui.Create("DButton",self.StartPanel)
		self.CloseButton:SetSize( 150/2-6, 20 )
		self.CloseButton:SetPos( 150/2+4, 25 )
		self.CloseButton:SetText( "Close" )
		self.CloseButton.DoClick = function() 
			PLUGIN.StartPanel:SetVisible( false ) 
		end
		
		self.MotdPanel = vgui.Create("DFrame")
		local w,h = ScrW() - 200,ScrH() - 200
		self.MotdPanel:SetPos( 100,100 )
		self.MotdPanel:SetSize( w,h )
		self.MotdPanel:SetTitle( "MOTD" )
		self.MotdPanel:SetVisible( false )
		self.MotdPanel:SetDraggable( false )
		self.MotdPanel:ShowCloseButton( true )
		self.MotdPanel:SetDeleteOnClose( false )
		self.MotdPanel:SetScreenLock( true )
		self.MotdPanel:MakePopup()
		
		self.MotdBox = vgui.Create("HTML",self.MotdPanel)
		self.MotdBox:StretchToParent( 4,25,4,4 )
		self.MotdBox:OpenURL( "http://sites.google.com/site/(yoursitename)" )
	end
	timer.Simple( 0.1, function() PLUGIN:CreateMenu() end)
	
	concommand.Add("evolve_motd",function(ply,cmd,args)
		PLUGIN.MotdPanel:SetVisible( true )
	end)
	
	concommand.Add("evolve_startmotd",function(ply,cmd,args)
		PLUGIN.StartPanel:SetVisible( true )
	end)
	
end

evolve:RegisterPlugin( PLUGIN )[/code]


Sep 13, 2010
#5 m.b.rai...@hotmail.com
sorry double post: also add the same link in ur blank motd  txt file in the garrysmod/data folder  
Oct 10, 2010
#6 epicsand...@gmail.com
So, that is a lua file? and I put the website link in where you put it in the lua, and I also put it in the motd file in the data folder?
Dec 18, 2010
#7 ADVsc...@gmail.com
You can also use 'sv_loadingurl' and point it to a url, so when some one downloads and loads, they see the rules, but its not interactive; but you can see a live feed of a forum, chat, you jacking off... what ever 
Apr 16, 2011
#8 bob_dol...@yahoo.com
I found that If you put the HTML into the plugin, it updates it to the current text you want, an example:

/*-------------------------------------------------------------------------------------------------------------------------
	Message of the Day
-------------------------------------------------------------------------------------------------------------------------*/

local PLUGIN = {}
PLUGIN.Title = "MOTD"
PLUGIN.Description = "Message of the Day."
PLUGIN.Author = "Divran"
PLUGIN.ChatCommand = "motd"
PLUGIN.Usage = nil
PLUGIN.Privileges = nil

function PLUGIN:Call( ply, args )
	self:OpenMotd( ply )
end

function PLUGIN:PlayerInitialSpawn( ply )
	timer.Simple( 1, function() ply:ConCommand("evolve_startmotd") end)
end

function PLUGIN:OpenMotd( ply )
	if (SERVER) then
		ply:ConCommand("evolve_motd")
	end
end

if (SERVER) then 
	if (file.Exists("evolvemotd.txt")) then
		resource.AddFile("data/evolvemotd.txt")
	end
end


if (CLIENT) then
	function PLUGIN:CreateMenu()
		self.StartPanel = vgui.Create( "DFrame" )
		local w,h = 150,50
		self.StartPanel:Center()
		self.StartPanel:SetSize( w,h )
		self.StartPanel:SetTitle( "Welcome!" )
		self.StartPanel:SetVisible( false )
		self.StartPanel:SetDraggable( true )
		self.StartPanel:ShowCloseButton( false )
		self.StartPanel:SetDeleteOnClose( false )
		self.StartPanel:SetScreenLock( true )
		self.StartPanel:MakePopup()
		
		self.OpenButton = vgui.Create("DButton",self.StartPanel)
		self.OpenButton:SetSize( 150/2-4, 20 )
		self.OpenButton:SetPos( 2, 25 )
		self.OpenButton:SetText( "Open MOTD" )
		self.OpenButton.DoClick = function() 
			PLUGIN.MotdPanel:SetVisible( true )
			PLUGIN.StartPanel:SetVisible( false ) 
		end
		
		self.CloseButton = vgui.Create("DButton",self.StartPanel)
		self.CloseButton:SetSize( 150/2-6, 20 )
		self.CloseButton:SetPos( 150/2+4, 25 )
		self.CloseButton:SetText( "Close" )
		self.CloseButton.DoClick = function() 
			PLUGIN.StartPanel:SetVisible( false ) 
		end
		
		self.MotdPanel = vgui.Create("DFrame")
		local w,h = ScrW() - 200,ScrH() - 200
		self.MotdPanel:SetPos( 100,100 )
		self.MotdPanel:SetSize( w,h )
		self.MotdPanel:SetTitle( "MOTD" )
		self.MotdPanel:SetVisible( false )
		self.MotdPanel:SetDraggable( false )
		self.MotdPanel:ShowCloseButton( true )
		self.MotdPanel:SetDeleteOnClose( false )
		self.MotdPanel:SetScreenLock( true )
		self.MotdPanel:MakePopup()
		
		self.MotdBox = vgui.Create("HTML",self.MotdPanel)
		self.MotdBox:StretchToParent( 4,25,4,4 )
		self.MotdBox:SetHTML( [[
                <html>
                <title>MOTD!</title>
                <body bgcolor="888888"> 
                <center><h1>Example MOTD/Instructions on how to set a proper                             MOTD</h1></center>
                <h2>Of course you have to be superadmin or owner.<br>
                You have two choices:</h2>
                <h3>Choice #1 (text file)</h3>
                <ol>
                <li>Simply edit addons/FAdmin/data/MOTD.txt <b>on the server</b><br>   </li>
                <li>Put your HTML source code in there. Clients will automatically                   download and use it.<br></li>
                <li><u>Currently this very page is in the MOTD.txt file, simply    delete content of MOTD.txt and replace it with your HTML code.</u><br></li>
                <li>Make sure FAdmin MOTDPage is set to data/FADmin/MOTD.txt. Do this by entering this command in console: FAdmin MOTDpage    garrysmod/gamemodes/Darkrp/content/data/FAdmin/motd.txt<br></li>
                </ol>

                <h3>Choice #2 (Website)</h3>
                <ol>
                <li>Copy the website to the clipboard<br></li>
                <li>Enter the command: FAdmin MOTDPage "your website here"<br><br>       </li>
                <i>Example:</i><br>
                FAdmin MOTDPage "www.facepunch.com"<br>
                <br>
                <i>Have fun!<br>(FPtje) Falco</i>
                </body>
                </html>
        ]] )

	end
	timer.Simple( 0.1, function() PLUGIN:CreateMenu() end)
	
	concommand.Add("evolve_motd",function(ply,cmd,args)
		PLUGIN.MotdPanel:SetVisible( true )
	end)
	
	concommand.Add("evolve_startmotd",function(ply,cmd,args)
		PLUGIN.StartPanel:SetVisible( true )
	end)
	
end

evolve:RegisterPlugin( PLUGIN )




Sep 13, 2011
#9 zipno...@gmail.com
I have no problem using the plugin located on the actual site called MOTD? It took me like 15 seconds to install...
Oct 3, 2012
#10 BlackMag...@gmail.com
Can Some One Make A link for this code above. im not sure if i made this file right ! ^^
______________

THANK YOU! ♣