Author Topic: Disabling the ULX MOTD from showing on connect.  (Read 6731 times)

0 Members and 1 Guest are viewing this topic.

Offline TryHardSnipr

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Disabling the ULX MOTD from showing on connect.
« on: April 20, 2015, 05:34:27 AM »
Hello,

I am using ULX on a NutScript Half Life 2 Roleplay server I own, and I would like to, at some point, customize and use the MOTD, although at the moment I have a problem where once a player has connected it shows them the MOTD but they are unable to click close without first pressing 'Esc' to open the Garry's Mod menu. Due to this I have it disabled at the moment, but I would like to either disable the MOTD on connect but still use the !motd command, or maybe someone knows a fix for this problem I am having. Any help is a appreciated.

-TryHardSnipr

Offline Djfurry Balls

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Re: Disabling the ULX MOTD from showing on connect.
« Reply #1 on: April 20, 2015, 08:23:25 AM »
hi tryhardsnipr,

if you look under the ULX settings tab and select server,
in the ULX general settings is an option to turn off MOTD on client join.

djfurryballs

Offline TryHardSnipr

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Re: Disabling the ULX MOTD from showing on connect.
« Reply #2 on: April 20, 2015, 08:57:24 AM »
Hey DJ,

Thanks for the help, but I already have this option unticked, this is how I was disabling the MOTD, but whilst it does disable it on join, it also stops users from being able to use !motd and tells them that the MOTD is disabled, which is a feature I would still like to have access to.

-TryHardSnipr

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: Disabling the ULX MOTD from showing on connect.
« Reply #3 on: April 20, 2015, 09:27:23 AM »
The easiest thing to do would be to remove the check in the following file:
https://github.com/Nayruden/Ulysses/blob/master/ulx/lua/ulx/modules/sh/menus.lua#L37-L40

Just remove or comment out those lines, and it should work for you. :)  Keep in mind, that if you update ULX/ULib in the future, you'll need to reapply this change, or the issue will come back.
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6

Offline TryHardSnipr

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Re: Disabling the ULX MOTD from showing on connect.
« Reply #4 on: April 20, 2015, 01:25:19 PM »
Thanks for the help Stickly, while this does remove the check, it doesn't bring back the MOTD, I would like to be able to actually see the MOTD with !motd but not have it show to people when they connect to my server.

-TryHardSnipr

Offline lynx

  • Jr. Member
  • **
  • Posts: 59
  • Karma: 15
Re: Disabling the ULX MOTD from showing on connect.
« Reply #5 on: April 20, 2015, 01:28:12 PM »
If you leave the MOTD enabled in the settings, then comment out line 29 in the file Stickly posted (the hook.Add line) it should work like a charm. That would disable the initial spawn MOTD sending instead of the cvar check on !motd

Offline TryHardSnipr

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Re: Disabling the ULX MOTD from showing on connect.
« Reply #6 on: April 20, 2015, 03:05:10 PM »
Thanks lynx, that looks like it's solved the problem!

Offline lynx

  • Jr. Member
  • **
  • Posts: 59
  • Karma: 15
Re: Disabling the ULX MOTD from showing on connect.
« Reply #7 on: April 20, 2015, 03:12:48 PM »
One good way if you want it to persist is to do the following:

In garrysmod/lua/autorun create a lua file (named something you can remember what it is) and put the following in it:
Code: [Select]
timer.Simple( 0.1, function( ) hook.Remove( "PlayerInitialSpawn", "showMotd" ) end )
That will have the server remove the hook that ULX uses to show the MOTD on nearly the next tick so it doesn't get sent to clients. That way you don't have to edit that file every time theres an update.