• Print

Author Topic: Psay echos to admins & TTT events get stored in log  (Read 7065 times)

0 Members and 1 Guest are viewing this topic.

Offline iSnipeu

  • Jr. Member
  • **
  • Posts: 83
  • Karma: 12
Psay echos to admins & TTT events get stored in log
« on: April 03, 2011, 05:20:09 am »
I currently run a TTT server with ulx svn installed.

My idea is that there should be a option that echos Pm's to all online admin so people cannot ghost.
Another idea i have is that the logs should record TTT events like damages, kills, etc, so you can check up on RDMers, etc.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: Psay echos to admins & TTT events get stored in log
« Reply #1 on: April 03, 2011, 08:45:13 am »
Untested, but try replacing the ulx.psay function in ulx/lua/ulx/modules/sh/chat.lua with the following.

So remove at line 5:
Code: Lua
  1. function ulx.psay( calling_ply, target_ply, message )
  2.         ulx.fancyLog( { target_ply, calling_ply }, "#P to #P: " .. message, calling_ply, target_ply )
  3. end

Replace with:
Code: Lua
  1. function ulx.psay( calling_ply, target_ply, message )
  2.         local echo_to = {}
  3.         local players = player.GetAll()
  4.         for _, ply in ipairs( players ) do
  5.                 if ply:IsAdmin() or ply == calling_ply or ply == target_ply then
  6.                         table.insert( echo_to, ply )
  7.                 end
  8.         end
  9.         ulx.fancyLog( echo_to, "#P to #P: " .. message, calling_ply, target_ply )
  10. end

To make TTT echo to the logs, insert ulx.logString( "Some action happened!" ) wherever there's something of relevance.
Experiencing God's grace one day at a time.

Offline iSnipeu

  • Jr. Member
  • **
  • Posts: 83
  • Karma: 12
Re: Psay echos to admins & TTT events get stored in log
« Reply #2 on: April 05, 2011, 03:31:38 am »
I got the psay to work, but I'm not sure where i should put the "ulx.logString".

  • Print