Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google Log In with Steam Sign In
  • Create Account
Photo

chat

- - - - -

  • Please log in to reply
6 replies to this topic

#1
OFFLINE   BettyBoop

BettyBoop

    Regular Member

  • Subscriber
  • PipPipPip
  • 132 posts
11
A step in the right direction
  • LocationFrance
did a way to have a separate chat .log for the next release instead to have all included in the etconsole.log ?

#2
OFFLINE   gaoesa

gaoesa

    Advanced Member

  • Management
  • PipPipPipPip
  • 4391 posts
341
Will become famous
  • LocationFinland
We will take this into consideration.

#3
OFFLINE   Sol

Sol

    Regular Member

  • Coders
  • PipPipPip
  • 113 posts
28
On a distinguished road
  • LocationPoland
Here you are, this is my simple script which I use it on my server.
logname = "chatlog.log"
function et_ClientCommand( num, cmd )
if cmd == "say" or cmd == "say_team" or cmd == "say_buddy" then
  if et.trap_Argc() > 1 then
   local msg  = ""
   local name = et.Q_CleanStr(et.gentity_get(num, "pers.netname"))
   for i = 1, et.trap_Argc() - 1 do
    msg = string.format("%s %s", msg, et.Q_CleanStr(et.trap_Argv( i )))
   end
   WriteToFile(logname, string.format("[%s]-[%s]: %s\n", os.date(), name, msg ))
  else
   local name = et.Q_CleanStr(et.gentity_get(num, "pers.netname"))
   local msg  = string.format("[%s]-[%s]: %s\n", os.date(), name, et.Q_CleanStr(et.trap_Argv(1)))
   WriteToFile(logname, msg)
  end
end
end
function WriteToFile( filename, str )
fd, len = et.trap_FS_FOpenFile( filename, et.FS_APPEND )
et.trap_FS_Write( str, string.len(str), fd )
et.trap_FS_FCloseFile( fd )
end


#4
OFFLINE   TheSilencerPL

TheSilencerPL

    Advanced Member

  • Management
  • PipPipPipPip
  • 3097 posts
216
On the road to fame
  • LocationPoland
little bit of creativity and there you have it :)

#5
OFFLINE   BettyBoop

BettyBoop

    Regular Member

  • Subscriber
  • PipPipPip
  • 132 posts
11
A step in the right direction
  • LocationFrance
thanks you a lot
with your help i made the lua script and add the line
i noticed for our server installation we have a liblua5.1.so
this will work with it ?

cuz they are different lua http://www.lua.org/download.html

Edited by McBeth, 09 July 2012 - 10:26 AM.


#6
OFFLINE   gaoesa

gaoesa

    Advanced Member

  • Management
  • PipPipPipPip
  • 4391 posts
341
Will become famous
  • LocationFinland
You don't need to have liblua5.1.so for this script. The Lua interpreter is ibuilt into the mod. If you do need to install external Lua libraries, then you also need to use the qagame that is found from the dynamic_lua folder. It allows loading the external dependencies properly.

#7
OFFLINE   wawin

wawin

    Member

  • Members
  • PipPip
  • 38 posts
4
A step in the right direction
Nice script and working great.
Thanks Sol.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users