I've created a seperate MOTD for both player and server staff usergroups, but I can't seem to get it to work. Is it possible? If yes, how?
I've tried to set ifs in the menus.lua file, not sure if i did something wrong or it's just not possible.
Here is the first part of the menus.lua file, I've edited the sendMotd function.
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( "adminmotdfile", "ulx_admin_motd.txt" ) -- Staff motd cvar
local function sendMotd( ply, showMotd )
if showMotd == "1" then -- Assume it's a file
if ply:IsUserGroup('moderator') or ply:IsUserGroup('admin') or ply:IsUserGroup('superadmin') then
if ply.ulxHasMotd then return end -- This player already has the motd
if not ULib.fileExists( GetConVarString( "adminmotdfile" ) ) then return end -- Invalid
local f = ULib.fileRead( GetConVarString( "adminmotdfile" ) )
end
if ply:IsUserGroup('user') or ply:IsUserGroup('regular') or ply:IsUserGroup('loyal') or ply:IsUserGroup('veteran') or ply:IsUserGroup('nolifer') or ply:IsUserGroup('goldnolifer') then
if ply.ulxHasMotd then return end -- This player already has the motd
if not ULib.fileExists( GetConVarString( "motdfile" ) ) then return end -- Invalid
local f = ULib.fileRead( GetConVarString( "motdfile" ) )
end
ULib.clientRPC( ply, "ulx.rcvMotd", false, f )
ply.ulxHasMotd = true