Author Topic: Denying Echoes To Others  (Read 2242 times)

0 Members and 1 Guest are viewing this topic.

Offline WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.
Denying Echoes To Others
« on: October 13, 2015, 08:27:31 PM »
I run a Garry's Mod server using ULX and ULib and on it me and my friends play a lot of TTT. Ive set up a working set of commands that work and function fine, but what Im wondering is that is there a way I can keep seeing all echoes from me/others (WispySkies set the hp of NAME to 1 vice versa) but when I perform a command the !COMMAND and the "WispySkies gave NAME x credits." is not visible to anyone (including superadmins, which is me as well, possible conflict?).

Thanks for any help you guys can give!

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Denying Echoes To Others
« Reply #1 on: October 13, 2015, 08:43:27 PM »
This would probably better fit in developers corner, as it's not directly asking for help with ULX usage, so, I'm moving it after I post.
Our ulx.command object has additional parameters not commonly used. One of those is a boolean to hide the say command.

Our function set-up;
function ulx.command( category, command, fn, say_cmd, hide_say, nospace )

So when setting up your commands, use;
local obj = ulx.command ( "My Category", "ulx blah", my_funcnameblah, "!my_say", true )
And that will prevent your say commands from showing in chat if no other conflicts occur/chat text code returns the text.
« Last Edit: October 13, 2015, 08:46:45 PM by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.
Re: Denying Echoes To Others
« Reply #2 on: October 14, 2015, 03:56:02 AM »
Since I just fully suck at Lua how would you implement that? I probably sound really stupid .-.

Offline WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.
Re: Denying Echoes To Others
« Reply #3 on: October 14, 2015, 04:19:41 AM »
One more thing as well, would I have to add that line through every function? Because I meant it for EVERY command that I do and I'd rather not mess around with the original ULX code. Is it possible to still hide the !COMMAND and "WispySkies set the HP of SOMEONE to 1" but just have a script in what I would think to be in C:/garrysmod/addons/ulx/lua/ulx/modules/sh/FILES.lua that automatically does that without changing all the other code?

Offline Storm

  • Full Member
  • ***
  • Posts: 220
  • Karma: 4
Re: Denying Echoes To Others
« Reply #4 on: October 14, 2015, 09:49:12 AM »
Can we do an example? I would like to know this too. So using ulx blind,


function ulx.blind( calling_ply, target_plys, amount, should_unblind )
   for i=1, #target_plys do
      local v = target_plys[ i ]
      umsg.Start( "ulx_blind", v )
         umsg.Bool( not should_unblind )
         umsg.Short( amount )
      umsg.End()
.
.
.
.

local blind = ulx.command( CATEGORY_NAME, "ulx blind", ulx.blind, "!blind")

So how would you change this so the echo never shows,even when logecho is on?

Offline WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.
Re: Denying Echoes To Others
« Reply #5 on: October 14, 2015, 10:57:22 AM »
JamminR, thoughts?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Denying Echoes To Others
« Reply #6 on: October 14, 2015, 03:15:16 PM »
Wispy, no need to rush for my thoughts. You and I are likely world time zones apart, and I'm not available here during weekdays GMT-5 from 23:45 to at least 18:00, and often much later.

There is no way to stop all ulx commands from echoing the chat portion.
I thought you were talking about commands you created, that you made.

Though you could disable echo mode in ULX settings, anyone using commands chat could still be seen saying "!blah".
You'd have to teach your admins/etc to use game console "ulx blah" in combo with echo off.
Logging would still occur.

local blind = ulx.command( CATEGORY_NAME, "ulx blind", ulx.blind, "!blind")

So how would you change this so the echo never shows,even when logecho is on?
You can't. You could only prevent the person using the chat command from being seen saying it. You'd still require echo being off to prevent echo of actions taken.
local blind = ulx.command( CATEGORY_NAME, "ulx blind", ulx.blind, "!blind", true)



« Last Edit: October 14, 2015, 03:19:27 PM by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline WispySkies

  • Full Member
  • ***
  • Posts: 144
  • Karma: 0
  • I make random commands and Lua errors.
Re: Denying Echoes To Others
« Reply #7 on: October 14, 2015, 04:46:58 PM »
Sorry about that, I did not intend to rush you. Ill try that thanks! Although I was talking about both commands I made, etc. Storm, after looking at this that will work for you. Just when in game create a new group, not inherited from SA and then give it every command except the ULX Echo.

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given