Change motdfile and motdurl to have "ulx " prefix.

This commit is contained in:
Nayruden 2016-01-30 15:04:02 -05:00
parent 1ba60154b5
commit a4440c49bc
3 changed files with 12 additions and 10 deletions

View File

@ -87,8 +87,8 @@ ulx showMotd 2 ; MOTD mode
; 2 - GENERATOR Uses the MOTD generator to create a MOTD for the player (use XGUI for this)
; 3 - URL Show the player the URL specified by the 'motdurl' cvar
; In a URL, you can use %curmap% and %steamid% in the URL to have it automagically parsed for you (eg, server.com/?map=%curmap%&id=%steamid%).
motdfile ulx_motd.txt ; The MOTD to show, if using a file. Put this file in the root of the garry's mod directory.
motdurl ulyssesmod.net ; The MOTD to show, if using a URL.
ulx motdfile ulx_motd.txt ; The MOTD to show, if using a file. Put this file in the root of the garry's mod directory.
ulx motdurl ulyssesmod.net ; The MOTD to show, if using a URL.
ulx chattime 0 ; Players can only chat every x seconds (anti-spam). 0 to disable

View File

@ -1,13 +1,11 @@
local CATEGORY_NAME = "Menus"
if ULib.fileExists( "lua/ulx/modules/cl/motdmenu.lua" ) or ulx.motdmenu_exists then
CreateConVar( "motdfile", "ulx_motd.txt" ) -- Garry likes to add and remove this cvar a lot, so it's here just in case he removes it again.
CreateConVar( "motdurl", "ulyssesmod.net" ) -- Garry likes to add and remove this cvar a lot, so it's here just in case he removes it again.
local function sendMotd( ply, showMotd )
if ply.ulxHasMotd then return end -- This player already has the motd data
if showMotd == "1" then -- Assume it's a file
if not ULib.fileExists( GetConVarString( "motdfile" ) ) then return end -- Invalid
local f = ULib.fileRead( GetConVarString( "motdfile" ) )
if not ULib.fileExists( GetConVarString( "ulx_motdfile" ) ) then return end -- Invalid
local f = ULib.fileRead( GetConVarString( "ulx_motdfile" ) )
ULib.clientRPC( ply, "ulx.rcvMotd", showMotd, f )
@ -15,7 +13,7 @@ if ULib.fileExists( "lua/ulx/modules/cl/motdmenu.lua" ) or ulx.motdmenu_exists t
ULib.clientRPC( ply, "ulx.rcvMotd", showMotd, ulx.motdSettings )
else -- Assume URL
ULib.clientRPC( ply, "ulx.rcvMotd", showMotd, GetConVarString( "motdurl" ) )
ULib.clientRPC( ply, "ulx.rcvMotd", showMotd, GetConVarString( "ulx_motdurl" ) )
end
ply.ulxHasMotd = true
end
@ -54,7 +52,7 @@ if ULib.fileExists( "lua/ulx/modules/cl/motdmenu.lua" ) or ulx.motdmenu_exists t
return
end
if GetConVarString( "ulx_showMotd" ) == "1" and not ULib.fileExists( GetConVarString( "motdfile" ) ) then
if GetConVarString( "ulx_showMotd" ) == "1" and not ULib.fileExists( GetConVarString( "ulx_motdfile" ) ) then
ULib.tsay( calling_ply, "The MOTD file could not be found." )
return
end
@ -64,9 +62,13 @@ if ULib.fileExists( "lua/ulx/modules/cl/motdmenu.lua" ) or ulx.motdmenu_exists t
local motdmenu = ulx.command( CATEGORY_NAME, "ulx motd", ulx.motd, "!motd" )
motdmenu:defaultAccess( ULib.ACCESS_ALL )
motdmenu:help( "Show the message of the day." )
if SERVER then ulx.convar( "showMotd", "2", " <0/1/2/3> - MOTD mode. 0 is off.", ULib.ACCESS_ADMIN ) end
if SERVER then end
if SERVER then
ulx.convar( "showMotd", "2", " <0/1/2/3> - MOTD mode. 0 is off.", ULib.ACCESS_ADMIN )
ulx.convar( "motdfile", "ulx_motd.txt", "MOTD filepath from gmod root to use if ulx showMotd is 1.", ULib.ACCESS_ADMIN )
ulx.convar( "motdurl", "ulyssesmod.net", "MOTD URL to use if ulx showMotd is 3.", ULib.ACCESS_ADMIN )
function ulx.populateMotdData()
if ulx.motdSettings == nil then return end

View File

@ -1 +1 @@
1454183840
1454184243