• Print

Author Topic: Disable chat messages from being broadcasted when using ULX commands.  (Read 28699 times)

0 Members and 1 Guest are viewing this topic.

Offline Edned

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Hello,

I have been wondering how to do this for a while, I have had issues with this for a while now.
Basically, whenever I do a command, as well as broadcasting the FancyLogAdmin message, it also broadcasts my player written message.
Here is an example of that:

Can this be stopped?

Kind Regards,
Edned

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Disable chat messages from being broadcasted when using ULX commands.
« Reply #1 on: November 01, 2015, 02:10:05 pm »
This is an optional parameter in the fancyLogAdmin call that would require modifying the core ULX files to hide.
I believe it's ulx.fancyLogAdmin(Player calling_ply, boolean hide_chat, string message, ...)
bw81@ulysses-forums ~ % whoami
Homepage

Offline Buzzkill

  • Respected Community Member
  • Full Member
  • *****
  • Posts: 176
  • Karma: 59
    • The Hundred Acre Bloodbath
Re: Disable chat messages from being broadcasted when using ULX commands.
« Reply #2 on: November 01, 2015, 02:26:13 pm »
I believe he's referring to squelching the log echo that occurs IN ADDITION to the fancylog call.   This would be "ulx logEcho 0"

If the desire is to squelch the fancylog output, then yes, edits would need to be made to core ULX modules (unless the command/s in question support a silent mode).

Offline WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.
Re: Disable chat messages from being broadcasted when using ULX commands.
« Reply #3 on: November 01, 2015, 02:55:30 pm »
Go to !menu, Settings, Admin Echo/Event Log and change it to "Do not echo admin commands" (Although this makes it for every command). Although if you want to hide the !god part you have to edit the ULX code found in your ~/garrysmod/garrysmod/addons/ulx/lua/ulx/modules/sh/ and open fun.lua. Scroll down to line 254 and change "function ulx.god( calling_ply, target_plys, should_revoke )" to "function ulx.god( calling_ply, target_plys, should_revoke, should_silent )" and then go to line 288 and replace the code between 282 and 286 with this. (It should mirror the should_revoke, I also added in notes so you know whats up)
Code: Lua
  1. if not should_revoke and should_silent then -- should_revoke is normal, after adding should_silent above, this allows it here
  2.                 ulx.fancyLogAdmin( calling_ply, true, "#A granted god mode upon #T", affected_plys ) -- The true hides the command, pretty much should_silent
  3.         else
  4.                 ulx.fancyLogAdmin( calling_ply, true, "#A revoked god mode from #T", affected_plys )
  5.         end

I am not responsible for any damage to your ULX code after you edit this. Saving a buckup IS advised. ::)

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Disable chat messages from being broadcasted when using ULX commands.
« Reply #4 on: November 01, 2015, 08:03:39 pm »
Disable echo and use game console.
Game console will even have auto complete for you, type ulx g and a selection of all commands starting with G in ulx will drop down, use arrow and select god.
From game console, no commands will echo to chat.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Edned

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Re: Disable chat messages from being broadcasted when using ULX commands.
« Reply #5 on: November 04, 2015, 08:48:45 am »
Thank you for the help, just to clear this up:
I DO want the fancylog to broadcast, but not as well as the player chat message :)
Thank you for the help, I'll edit the code :)

Offline WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.
Re: Disable chat messages from being broadcasted when using ULX commands.
« Reply #6 on: November 04, 2015, 01:23:22 pm »
Thank you for the help, just to clear this up:
I DO want the fancylog to broadcast, but not as well as the player chat message :)
Thank you for the help, I'll edit the code :)
Alright then, but be sure to save a backup if you lose the old code or mess up. Heres the GitHub original code:
https://github.com/Nayruden/Ulysses/blob/master/ulx/lua/ulx/modules/sh/fun.lua

Couldn't paste file code, it exceeded the 20000 character limit. Gg Ulysses.

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: Disable chat messages from being broadcasted when using ULX commands.
« Reply #7 on: November 04, 2015, 07:07:23 pm »
Alright then, but be sure to save a backup if you lose the old code or mess up. Heres the GitHub original code:
https://github.com/Nayruden/Ulysses/blob/master/ulx/lua/ulx/modules/sh/fun.lua

Better yet, don't touch the default ULX files and instead make your own addon folder to hold all your modifications!
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: Disable chat messages from being broadcasted when using ULX commands.
« Reply #8 on: November 04, 2015, 10:37:58 pm »
Better yet, don't touch the default ULX files and instead make your own addon folder to hold all your modifications!

That's like a slap in the face.
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.

Offline Edned

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Re: Disable chat messages from being broadcasted when using ULX commands.
« Reply #10 on: November 05, 2015, 12:48:09 pm »
It seems that WispySkies' suggestion did not work for me.
It just did this:
[Superadmin] [FL:RP] Edned: !god Edned *
(SILENT) You revoked god mode from Yourself

I didn't want the command to silent, I only wanted the line with the * to not show up for anyone

Offline WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.
Re: Disable chat messages from being broadcasted when using ULX commands.
« Reply #11 on: November 05, 2015, 02:13:27 pm »
Then pop this in your console: bind KEY "ulx noclip"

With quotes an all, trust me, change KEY to the key you want.

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: Disable chat messages from being broadcasted when using ULX commands.
« Reply #12 on: November 05, 2015, 03:00:16 pm »
If you don't want the chat message to appear then you will need to edit each and every command. As JamminR and WispySkies pointed out, you can just use console to use the commands.
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline Timmy

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 252
  • Karma: 168
  • Code monkey
Re: Disable chat messages from being broadcasted when using ULX commands.
« Reply #13 on: November 05, 2015, 04:07:17 pm »
Mhm... What about this?
Code: Lua
  1. hook.Add("ULibCommandCalled", "ulib_hide_saycmds", function()
  2.     for str in pairs(ULib.sayCmds) do
  3.         ULib.sayCmds[str].hide = true
  4.     end
  5.     hook.Remove("ULibCommandCalled", "ulib_hide_saycmds")
  6. end)

Attached in addon format. Extract the .zip in your addons folder and restart your server.

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: Disable chat messages from being broadcasted when using ULX commands.
« Reply #14 on: November 05, 2015, 04:11:47 pm »
Why is it in that hook? Autorun would work fine, no?
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

  • Print