• Print

Author Topic: Command echo  (Read 4891 times)

0 Members and 1 Guest are viewing this topic.

Offline no1stargeorge

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Command echo
« on: July 30, 2016, 11:16:30 am »
so i have been trying for a while to get this thing to work. So i am trying to make it so that only people with a certain permission can view the command echo so that it does not spam chat unless you are lets say an admin or something

note: it is a starwarsrp server

Offline no1stargeorge

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Re: Command echo
« Reply #1 on: July 30, 2016, 11:20:18 am »
If you need anything else i will respond as quickly as i can with it

Offline Timmy

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 252
  • Karma: 168
  • Code monkey
Re: Command echo
« Reply #2 on: July 30, 2016, 02:43:13 pm »
You can flag all command echos to be silent/hidden, so only players with access to "ulx hiddenecho" can see them (+ the player calling the command). :)

1) Making all command echos silent:
This can be done in various ways. The script below modifies ulx.fancyLogAdmin so command echos are always silent.
Code: Lua
  1. local fancyLogAdmin = ulx.fancyLogAdmin
  2.  
  3. function ulx.fancyLogAdmin( calling_ply, format, ... )
  4.     local formatType = type( format )
  5.  
  6.     if formatType == "boolean" then
  7.         return fancyLogAdmin( calling_ply, true, ... )
  8.     end
  9.        
  10.     if formatType == "string" then
  11.         return fancyLogAdmin( calling_ply, true, format, ... )
  12.     end
  13.  
  14.     return fancyLogAdmin( calling_ply, format, ... )
  15. end
I have attached the script to this post in addon format. You can add it to your server by extracting the .zip in the addons folder and restarting your server.

2) Give groups/players worthy of receiving command echos access to "ulx hiddenecho":
Code: [Select]
ulx groupallow operator "ulx hiddenecho"
ulx userallow Timmy "ulx hiddenecho"
« Last Edit: July 18, 2017, 02:16:27 am by Timmy »

Offline no1stargeorge

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Re: Command echo
« Reply #3 on: July 30, 2016, 03:21:32 pm »
Thank you

  • Print