TraceIV / evolvemod

Automatically exported from code.google.com/p/evolvemod
0 stars 0 forks source link

New feature (forced download or new MOTD system) #77

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by epicsand...@gmail.com on 28 May 2010 at 5:54

GoogleCodeExporter commented 9 years ago
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.

Original comment by ayr...@gmail.com on 28 May 2010 at 10:36

GoogleCodeExporter commented 9 years ago
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.

Original comment by overv161@gmail.com on 28 May 2010 at 1:30

GoogleCodeExporter commented 9 years ago
Thank you so much for your dedication. I am looking much forward to the new 
updates!

Original comment by epicsand...@gmail.com on 29 May 2010 at 1:35

GoogleCodeExporter commented 9 years ago
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]

Original comment by m.b.rai...@hotmail.com on 13 Sep 2010 at 4:36

GoogleCodeExporter commented 9 years ago
sorry double post: also add the same link in ur blank motd  txt file in the 
garrysmod/data folder  

Original comment by m.b.rai...@hotmail.com on 13 Sep 2010 at 4:39

GoogleCodeExporter commented 9 years ago
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?

Original comment by epicsand...@gmail.com on 10 Oct 2010 at 7:17

GoogleCodeExporter commented 9 years ago
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 

Original comment by ADVsc...@gmail.com on 18 Dec 2010 at 9:35

GoogleCodeExporter commented 9 years ago
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 on the server<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 )

Original comment by bob_dol...@yahoo.com on 17 Apr 2011 at 12:47

GoogleCodeExporter commented 9 years ago
I have no problem using the plugin located on the actual site called MOTD? It 
took me like 15 seconds to install...

Original comment by zipno...@gmail.com on 13 Sep 2011 at 2:19

GoogleCodeExporter commented 9 years ago
Can Some One Make A link for this code above. im not sure if i made this file 
right ! ^^
______________

THANK YOU! ♣

Original comment by BlackMag...@gmail.com on 3 Oct 2012 at 11:19