assmod motd

i want to add a motd to assmod but i dont know how i will do it plz help. i have assmod from steamworkshop installed.

Check if there’s anything in assmod/lua/plugins

there is no motd there. i found and old version of assmod plugins but they dont work with the new one

[editline]30th September 2013[/editline]

any idea of how i make a motd without assmod that will work with a html file i made?

“assmod” and “motd” just make me laugh.

is assmod “Mod Of The Decade.”

… motd stands for messages of the day

It was sarcasm.

Looks like you’ll just need to manually update the plugin to GMod 13.

i get an error that say:
[ERROR] addons/assmod for garry’smod 13/lua/plugins/ass_motd.lua:56: bad argumen
t #2 to ‘Exists’ (string expected, got no value)

  1. Exists - [C]:-1
  2. unknown - addons/assmod for garry’smod 13/lua/plugins/ass_motd.lua:56
    3. include - [C]:-1
    4. ASS_LoadPlugins - addons/assmod for garry’smod 13/lua/ass_plugins.lua:16
    4
    5. v - addons/assmod for garry’smod 13/lua/ass_server.lua:216
    6. unknown - lua/includes/modules/hook.lua:82

any idea of where i can download the update for plugin to gmod 13?

There is none; you’ll have to convert it yourself or hire someone to do it.

Put it on pastebin and I’ll do it for you.

here is it: http://pastebin.com/SqsP2SSN

Things I changed

[lua]
local PLUGIN = {}

PLUGIN.Name = “ASSmod MOTD”
PLUGIN.Author = “PC Camp, Updated by Pandaman09”
PLUGIN.Date = “October 2013”
PLUGIN.Filename = PLUGIN_FILENAME
PLUGIN.ClientSide = true
PLUGIN.ServerSide = true
PLUGIN.APIVersion = 3
PLUGIN.Gamemodes = {}

if CLIENT then
/====================================================
================== CONFIGURATION =====================
====================================================
/
ASSMOTD_TimeToWait = 5 – The time needed until the player can exit the MOTD in seconds
end

if SERVER then
– ONLY EDIT THE FOLLOWING IF YOU ARE DOING A FRESH INSTALL OF THIS PLUGIN
– Check and see if there is a folder in your data folder called “ASSmod”
– The directory of the saved MOTD is “garrysmod/data/ASSmod/motd.txt”
– If that file exists, the HTML below us will not be ran
ASSMOTD_HTMLScript = [[
<html>
<body bgcolor=#FFFFFF>
<div style=“text-align: center;”>
<div style=“width: 80%; margin: 0px auto; border: 10px solid #3366FF; background-color: #B0B0B0; padding: 10px; font-size: 12px; font-family: Tahoma; margin-top: 30px; color: #000066; text-align: left;”>
<div style=“font-size: 30px; font-family: impact; width: 100%; margin-bottom: 5px;”>My Server Name</div><br>
<h2>News:</h2>
The server startet edit this text in addons/assmod/lua/plugins/ass_motd.lua<br>
<br>
<h2>Rules:</h2>
1. Don’t mess with other players.<br>
2. Don’t spam ever. You will be Banned.<br>
3. Have fun!<br>
<br>
<h2>Admins:</h2>
Your Name
<div style=“width: 100%; text-align: center; margin: 10px; font-weight: bold;”>- Server Owner</div>
</div>
</div>
</body>
</html>
]]
end

/*====================================================

====================================================*/

if (SERVER) then

if not file.Exists( "ASSmod/motd.txt", "DATA" ) then -- Changed from file.Exists( "ASSmod/motd.txt" ) to file.Exists( "ASSmod/motd.txt", "DATA" ). You need the "DATA" part to say where the file is.
	file.Write( "data/ASSmod/motd.txt", ASSMOTD_HTMLScript )
end
if file.Exists( "ASSmod/motd.txt", "DATA" ) then -- same as above
	resource.AddFile( "data/ASSmod/motd.txt" )
end

function PLUGIN.OpenMOTDWhenPlayerSpawns( ply )
	ply:ConCommand( "ASS_MotdOpen" )
end
hook.Add( "PlayerInitialSpawn", "OpenMOTDWhenPlayerSpawns", PLUGIN.OpenMOTDWhenPlayerSpawns )

function PLUGIN.DeleteOldMOTDWhenDisCon( ply )
	umsg.Start( "DeleteMOTD", ply )
	umsg.End()
end
hook.Add( "PlayerDisconnected", "DeleteOldMOTDWhenDisCon", PLUGIN.DeleteOldMOTDWhenDisCon )

end

if (CLIENT) then

function PLUGIN.OpenMOTD( ply, cmd, args )

	local MOTDFrame = vgui.Create( "DFrame" )
	MOTDFrame:SetTitle( "ASS MOTD" )
	MOTDFrame:SetSize( ScrW() - 100, ScrH() - 100 )
	MOTDFrame:Center()
	MOTDFrame:ShowCloseButton( false )
	MOTDFrame:SetBackgroundBlur( true )
	MOTDFrame:SetDraggable( false )
	MOTDFrame:SetVisible( true )
	MOTDFrame:MakePopup()

	local MOTDHTMLFrame = vgui.Create( "HTML", MOTDFrame )
	MOTDHTMLFrame:SetPos( 25, 50 )
	MOTDHTMLFrame:SetSize( MOTDFrame:GetWide() - 50, MOTDFrame:GetTall() - 150 )
	MOTDHTMLFrame:SetHTML( file.Read( "ASSmod/motd.txt" ) )
	
	local CloseButton = vgui.Create( "DButton", MOTDFrame )
	CloseButton:SetSize( 100, 50 )
	CloseButton:SetPos( ( MOTDFrame:GetWide() / 2 ) - ( CloseButton:GetWide() / 2 ), MOTDFrame:GetTall() - 75 )
	CloseButton:SetText( "Close" )
	CloseButton:SetVisible( false )
	CloseButton.DoClick = function() 
		MOTDFrame:Remove()
	end
	
	timer.Simple( ASSMOTD_TimeToWait, function()
		CloseButton:SetVisible( true )
	end )

end
concommand.Add( "ASS_MotdOpen", PLUGIN.OpenMOTD )

function PLUGIN.DeleteOldMOTDWhenLeave( ply )
	file.Delete( "ASSmod/motd.txt" )
end
hook.Add( "ShutDown", "DeleteOldMOTDWhenLeave", PLUGIN.DeleteOldMOTDWhenLeave )
usermessage.Hook( "DeleteMOTD", PLUGIN.DeleteOldMOTDWhenLeave )

function PLUGIN.ShowMOTD(MENUITEM)
	RunConsoleCommand( "ASS_MotdOpen" )
end
function PLUGIN.AddNonAdminMenu(MENU)
	MENU:AddOption( "View MOTD", PLUGIN.ShowMOTD )
end

end

ASS_RegisterPlugin(PLUGIN)
[/lua]
Try to learn the simple fix.

That was the only thing outdated with it? I thought I’d be a lot more broken. Sorry for being so rude earlier.

I figured there would be too… But that’s the only thing I saw :stuck_out_tongue:

[editline]2nd October 2013[/editline]

Well I could have changed it over to net messages, but I didn’t feel like it.

thank you so super muchXD

[editline]2nd October 2013[/editline]

almost fixed. now i cant join. get an error that say “to many lua errors! sorry”
i will try to fix it by my self.
there is an error on lane 94

[editline]2nd October 2013[/editline]

what is wrong with this lane?

l


local MOTDHTMLFrame = vgui.Create( "HTML", MOTDFrame )
		MOTDHTMLFrame:SetPos( 25, 50 )
		MOTDHTMLFrame:SetSize( MOTDFrame:GetWide() - 50, MOTDFrame:GetTall() - 150 )
		MOTDHTMLFrame:SetHTML(file.Read ("ASSmod/motd.html", "DATA") )

idk, what were the errors


local MOTDHTMLFrame = vgui.Create( "HTML", MOTDFrame )
MOTDHTMLFrame:SetPos( 25, 50 )
MOTDHTMLFrame:SetSize( MOTDFrame:GetWide() - 50, MOTDFrame:GetTall() - 150 )
MOTDHTMLFrame:SetHTML(file.Read ("ASSmod/motd.txt", "DATA") )

somewere here is the error

[editline]2nd October 2013[/editline]

you can only see the error when you enter the server.

the error say:


[ERROR] addons/assmod for garry'smod 13/lua/plugins/ass_motd.lua:95: bad argumen
t #1 to 'SetHTML' (string expected, got no value)
  1. SetHTML - [C]:-1
   2. unknown - addons/assmod for garry'smod 13/lua/plugins/ass_motd.lua:95
    3. unknown - lua/includes/modules/concommand.lua:69

Does assmod/motd.txt exist in the data folder?

[editline]2nd October 2013[/editline]

Because it looks right http://wiki.garrysmod.com/page/Panel/SetHTML

yea assmod/motd.txt exist thats why im confused

if i remove file.Read("/ASSmod/motd.txt, DATA") then it works exept the assmod/motd.txt file dont load

Change this


MOTDHTMLFrame:SetHTML(file.Read ("ASSmod/motd.txt", "DATA") )

to this


MOTDHTMLFrame:SetHTML(file.Read ("motd.txt", "DATA") )

i have already tried that. got the same error

this is so weird

[editline]3rd October 2013[/editline]

the ass_motd dont create the motd file as it is suppost to do.